top of page

Most Important HTML-CSS Placement Questions and Answers

Updated: Oct 15, 2022

Any profession that needs coding will almost certainly require at least some expertise with HTML and CSS, and the first step to learning HTML and CSS is just understanding what they are and what they are used for. As we've seen, these two coding languages constitute the foundation of each web page and are crucial to web development.


Following is the list of most important HTML-CSS MCQ questions and answers to help you crack best company placements.

Basic HTML-CSS Placement Questions


Q1. Choose the correct statement.

  • In traditional XHTML close tag for some elements is optional but not encouraged

  • In both traditional XHTML and HTML close tag for some elements is not optional

  • In traditional HTML close tag for some elements is optional but not encouraged

  • In both traditional XHTML and HTML close tag for some elements is optional

Correct Answer: C

Explanation: In XHTML all elements must always be closed and empty elements also be closed. HTML is case insensitive and thus closing tags for some elements including empty elements is optional and is ignored by browsers.



Q2. Which of the following is not a difference between HTML and XHTML?

  • Charset in both html and xhtml is “text/html”

  • Charset in html is “text/html” where as in xhtml it is “application/xml+xhtml”

  • Tags and attributes are case-insensitive in HTML but not in XHTML

  • Special characters must be escaped using character entities in XHTML unlike HTML

Correct Answer: A

Explanation: HTML is case insensitive while XHTML is case sensitive. In XHTML, special characters can be escaped using character entities but not in HTML. Charset in HTML is “text/html” where as it is “application/xml + xhtml” for XHTML.


Q3. Which one of the following is an open source JavaScript library that enables styling for HTML5 elements in versions of Internet Explorer before IE 9?

  • HTML5


  • HTML5 Shiv

  • HTML5 Shim

  • HTML5 Sham

Correct Answer: B

Explanation: HTML5 Shiv is a JavaScript workaround, to enable styling of HTML5 elements in versions of Internet Explorer prior to version 9, which do not allow unknown elements to be styled without JavaScript. HTML 5 defines the properties and behaviors of web page content.


Q4. Which property is used to detect the browser’s user agent and code based on the pertinent cases?

  • return

  • navigator.user

  • navigator

  • navigator.userAgent

Correct Answer: D

Explanation: An old strategy was to look at the property navigator.userAgent to detect the browser’s user agent and code based on the pertinent cases.


Q5. Which of the following is an open source JavaScript library that allows support for different levels of experiences based on the capabilities of each browser?

  • Modernizr

  • Geolocation

  • Navigator

  • Google API

Correct Answer: A

Explanation: Modernizr is an open source JavaScript library that allows support for different levels of experiences based on the capabilities of each browser using a simple feature detection model.

  • Geo-location: the identification of geographic location of an object.

  • Navigator: object contains information about the browser.

  • Google API: set of application programming interface which allow communication with Google Services & integration to other services.


Q6. Which protocol is supported by Android browsers?

  • HTTPS

  • HLS

  • RTMP

  • FTP

Correct Answer: A

Explanation: HTTPS i.e. Hypertext Transfer Protocol Secure is used on internet. HLS, Hypertext Transfer Protocol Live Streaming, is supported by android browsers. RTMP stands for Real-Time Messaging Protocol, FTP stands for File Transfer Protocol.


Q7. Which of the following is not a HTML5 tag?

  • <video>

  • <source>

  • ]<track>

  • <slider>

Correct Answer: D

Explanation: <video> tag is used to display video clips in HTML5. Multiple media resources for media elements is specified by <source> tag. Text track for media elements i.e. <audio> & <video> is provided by <track> tag in HTML5. There is no such thing as slider tag in HTML5.


Q8. What will happen if height and width of video are not set while video loads?

  • Page flickers

  • page does not load

  • page crash

  • page closes

Correct Answer: A

Explanation: If height and width are not set, the browser does not know the size of the video. The effect will be that the page will change (or flicker) while the video loads.



Q8. Which of the following browser does not support wav file format?

  • Opera

  • Firefox

  • Chrome

  • Internet Explorer

Correct Answer: D

Explanation: Audio file format named wav is not supported by internet explorer out of Opera, Firefox, chrome and internet explorer.


Q9. In HTML Audio/Video DOM __________ returns a TextTrackList object representing the available text tracks.

  • readyState

  • startDate

  • videoTracks

  • textTracks

Correct Answer: D

Explanation: The current ready state of video/audio is set by readyState. StartDate sets current date representing current time offsets. VideoTracks returns video track list representing available video tracks. The textTracks property returns a TextTrackList object. Each available text track is represented by a TextTracks Object.


Q10. The __________ attribute effectively renders the iframe as an inline include, which allows the parent document’s CSS to affect the contents of the iframe.

  • allow-forms

  • seamless

  • Embed

  • allow-scripts

Correct Answer: B

Explanation: Embed attribute attach external content at a specified point in document. The seamless attribute is a Boolean attribute. When present, it specifies that the iframe should look like it is a part of the containing document (no borders or scrollbars). Allow-forms re-enables from submission. Scripts are re-enabled by allow-scripts.


Q11. In the processing of information, the server does not use which of the following language:

  • C#

  • JAVA

  • C++

  • VB.net

Correct Answer: C

Explanation: When we enter a new value through form it goes to the server for processing information and this information is processed using languages C#, PHP, JAVA or VB.net. The database can also store the information.




For more HTML-CSS questions and answers download our free handbook below.

 

Mobiprep handbooks are free downloadable placement preparation resources that can help you ace any company placement process. We have curated a list of the 40 most important MCQ questions with detailed explanations to ensure the best placement preparation.





 

842 views0 comments

Recent Posts

See All

Comentários


bottom of page