HTML MCQs

HTML MCQs

Try to answer these 800 HTML MCQs and check your understanding of the HTML subject. Scroll down and let's begin!

1: What is the purpose of this HTML statement? <SCRIPT type="text/javascript">

A.   None of these

B.   To define JavaScript code

C.   To format text

D.   To define an applet

2: Which HTML attribute is used to set the space between cells in an HTML <TABLE> element?

A.   cellpadding

B.   cellspacing

C.   cellspan

D.   cellspace

3: Increasing the cellpadding value will what ?

A.   Decrease the space between cells

B.   Increase the space between cells

C.   Increase the distance between cell and content

D.   Increase the softness of your site

E.   Decrease the softness of your site

4: What is a deprecated HTML element or attribute?

A.   A feature that can only be used once in the HTML document.

B.   An outdated feature that may become obsolete in future versions of HTML.

C.   A feature that has more than one defined use.

D.   An underused feature that is only used by experts.

5: What is this? <a href="/some/page#foo">Label</a>

A.   A link to the resource "/some/page". When visited the browser will attempt to jump the viewport to an element with an id="foo"

B.   A link to the resource "/some/page". The "foo" is the query string.

C.   A link to the resource "/some/page#foo" (a file on the web server by that name).

6: Which HTML specification contains definitions for the elements: <article>, <nav>, <header> and <footer>?

A.   HTML 4.01

B.   XHTML 1.0

C.   HTML 3.2

D.   HTML5

E.   All of these.

7: Which of the following is the correct doctype declaration for HTML5?

A.   <!DOCTYPE html>

B.   <!HTML>

C.   <!DOCTYPE html5>

D.   <!HTML5>

8: <pre> tag defines:

A.   block of code for presentation

B.   preformatted text

C.   prerequisites for a new block of text

9: Choose the valid HTML comment.

A.   <!-- Comment -->

B.   <-- Comment -->

C.   <!-- Comment --!>

10: What is the preferred way for adding a background color in HTML?

A.   <background>yellow</background>

B.   <body style="background-color:yellow;">

C.   <body background="yellow">

11: What symbol differentiates most opening tags from closing tags?

A.   /

B.   !

C.   ;

D.   .

E.   #

12: What are the three list types in HTML?

A.   Unordered, Ordered, Definitions

B.   Random, Numbered, Definitions

C.   Unordered, Numbered, Definitions

D.   Random, Ordered, Footnotes

13: Which HTML tag is an inline element?

A.   <span>

B.   <p>

C.   <ul>

D.   <div>

A.   alt

B.   name

C.   alternative

D.   id

E.   str

15: The HTML <BUTTON> tag

A.   returns the user to the home page.

B.   makes an image a link.

C.   specifies when to submit HTML form data.

D.   creates a push button on a form.

16: What does the following HTML tag display? <DIV id="text" align="right">content</DIV>

A.   A DIV with a class called text and its content aligned center.

B.   A DIV with an id called text and its content aligned right.

C.   A DIV with an id called text and its content aligned left.

D.   A DIV with a class called text and its content aligned right.

17: How do you create a radio type on an HTML form?

A.   <p><input button="rad" value="radio"></p>

B.   <p><input type="radio" value="rad"></p>

C.   <p><input value="radio" name="rad"></p>

18: What is the highest level element on a given page?

A.   <body>

B.   <section>

C.   <html>

D.   <head>

19: Which answer best describes the following HTML? <OL><LI>1</LI><LI>2</LI><LI>3</LI></OL>

A.   A numbered list with 3 options

B.   An unnumbered list with 3 options

C.   An unnumbered list with 2 options

D.   A numbered list with 2 options

20: What is the primary difference between a DIV and a SPAN element?

A.   DIV is commonly used and SPAN is deprecated

B.   A DIV is used for block level elements and a SPAN is used for inline elements.

C.   A DIV is used with primary elements while a SPAN is used with secondary elements.

D.   A DIV is used for inline elements and a SPAN is used for block level elements.

21: True or False? The "charset" attribute can be applied to only one <meta> element per HTML document.

A.   False

B.   True

A.   _blank

B.   _parent

C.   _son

23: The <div> element is an example of...

A.   a block element

B.   a diverse element

C.   a layer

D.   an inline element

24: Which attribute can be used with the <img> tag to override or reserve the dimensions of the box?

A.   vert / horiz

B.   height / width

C.   fallback-dimensions="width" and fallback-dimensions="height"

D.   x / y

25: What is the correct HTML tag for an inline frame?

A.   <IFRAME>

B.   <INLINEFRAME>

C.   <INFRAME>

D.   <INLINE>

26: If you don’t want the frame windows to be resizeable, simply add what to the <frame> lines

A.   noresize

B.   save

C.   dontresize

27: Why should you add alternative text to your images ?

A.   In case the user wishes to load a different picture

B.   So the user can save the image using the text as a name

C.   So the users can get an idea of what the image is before it loads

28: Which attribute would you use to specify how many rows an HTML table cell should span?

A.   rwspan

B.   row span

C.   row_span

D.   rowspan

29: Which HTML tags are used to turn text underlining on and off?

A.   <ULine> and </Uline>

B.   <U> and </U>

C.   <STRIKE> and </STRIKE>

D.   <L> and </L>

30: The correct way to add a blank space into the markup of your HTML is to use  ?

A.   True

B.   False

31: Which attribute of the <IMG> tag tells the browser what to display if a user cannot view the image?

A.   info

B.   alt

C.   img info

D.   text

32: Which of the following HTML elements does NOT belong in the <HEAD> section of an HTML file?

A.   <META>

B.   <TITLE>

C.   <LINK>

D.   <H1>

33: HTTP stands for...

A.   Hypertext Transmission Protocol

B.   Hypertext Transfer Protocol

C.   High Transmission Transfer Protocol

D.   Hypertext Trend Protocol

A.   title

B.   alt

C.   target

D.   open

E.   follow

35: What is the purpose of the HTML <EM> tag?

A.   To define external interactive content

B.   To define a table caption

C.   To define emphasized text

D.   To define a body element

E.   None of these

36: What is a use for the class attribute in HTML?

A.   as a script defined by XHTML

B.   to select a class in a style sheet

C.   as a META variable

D.   as a marker for an HTML function

37: Which of the following is an example of an HTML hidden field?

A.   <INPUT="hidden" />

B.   <INPUT type="hide" />

C.   <INPUT field="hidden" />

D.   <INPUT type="hidden" />

A.   vertical link

B.   visited link

C.   active link

D.   unvisited link

39: What is the purpose of html?

A.   HTML simplifies database connectivity

B.   HTML provides functionality to manipulate the DOM

C.   HTML provides structure for web pages

D.   HTML controls the MVC design pattern

E.   HTML adds style to static web elements

40: Why would you use the HTML <DIV> tag?

A.   None of these

B.   To apply a <B> or <I> tag to a part of a web page.

C.   To format grouped block-elements with styles.

D.   To insert JavaScript code or an applet.

41: Which attribute gives a unique identity for an HTML element?

A.   class

B.   identity

C.   div

D.   id

42: <__________________________ content="A description of your page"> Fill in the blank to create a tag that would give a description of your page.

A.   cssvalue

B.   description

C.   div change="keyword"

D.   marquee

E.   meta name="description"

43: Which tag is known as Subscript?

A.   <sub >

B.   <sp>

C.   <ss>

D.   <ssp>

E.   <sup>

44: Which HTML tag contains the main visual content of an HTML document?

A.   <BODY>

B.   <DOC>

C.   <HEAD>

D.   <SITE>

45: Which Specifies the maximum number of characters for the text field?

A.   None

B.   maximumlength

C.   maxlength

D.   largelength

46: Which HTML tag creates a horizontal line?

A.   <HR>

B.   <LINE>

C.   <HL>

D.   <H>

47: Which of the following HTML elements denotes the name of the page?

A.   <TITLE>

B.   <NAME>

C.   <PAGE TITLE>

D.   <PAGE NAME>

48: What is the purpose of a span tag?

A.   implement a visual change

B.   group in-line elements in a document

49: What does <A href="#title2"> create?

A.   A named area on the web page called title2.

B.   The word title in Heading Style 2.

C.   A hyperlink within a web page to an area named title2.

D.   A caption to an image called title2.

50: Which one is the mandatory attribute of the <img> tag?

A.   SRC

B.   ID

C.   HREF

D.   ALT