XHTML MCQs

XHTML MCQs

Our team has conducted extensive research to compile a set of XHTML MCQs. We encourage you to test your XHTML knowledge by answering these 100+ multiple-choice questions provided below.
Simply scroll down to begin!

1: Which of these is well formed?

A.   <Body>

B.   <body>

C.   <BODY>

2: Which of the following is a correct processing instruction?

A.   <!-- xml version=1.0 encoding=UTF-8 -->

B.   <?xml version="1.0" encoding="UTF-8"?>

C.   <!-- xml version="1.0" encoding="UTF-8" -->

D.   <?xml version=1.0 encoding=UTF-8?>

3: What is a namespace?

A.   A set of allowable attributes for an element

B.   The way we refer to the list of elements provided in a given document

C.   Another word for a DTD

D.   A predicate that is used to make a set of elements unique and avoid conflict

4: Which is the correct method of defining the default option that's in the select group?

A.   <select name="list" id="list"> <option value="1" selected>One</option> <option value="2">Two</option> <option value="3">three</option> </select>

B.   <select name="list" id="list"> <option value="1" selected>One</option> <option value="2" selected>Two</option> <option value="3" selected>three</option> </select>

C.   <select name="list" id="list"> <option value="1" >One</option> <option value="2">Two</option> <option value="3" selected="selected">three</option> </select>

5: What is the correct usage of the label element?

A.   <form method="post" action="action.php"> <label>Name</label> <input type="text" name="name" id="name" /> </form>

B.   <form method="post" action="action.php"> <label for="name">Name</label> <input type="text" /> </form>

C.   <form method="post" action="action.php"> <label for="name">Name</label> <input type="text" name="name" id="name" /> </form>

6: Which is the correct formatting of an object tag?

A.   <object type="application/x-shockwave-flash" data="silly.swf" width="700" height="500"></object>

B.   <object type="application/x-shockwave-flash" data="silly.swf" width="700" height="500" />

C.   <object type=application/x-shockwave-flash data=silly.swf width=700 height=500 />

D.   <object type=application/x-shockwave-flash data=silly.swf width=700 height=500></object>

7: Which of these is an inline element by default?

A.   h1

B.   div

C.   span

D.   fieldset

8: Which is NOT an acceptable XHTML DOCTYPE?

A.   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

B.   <!DOCTYPE html>

C.   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

D.   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

A.   target="_new"

B.   open="new"

C.   open="_window"

D.   target="_top"

10: Which of these are well-formed nesting?

A.   All of these

B.   <div><h1>Goodbye!</h1></div>

C.   <h1><div>Goodbye!</h1></div>

D.   <p><strong>Hello!</p></strong>

11: The correct tag for defining a table header cell is:

A.   <header>

B.   <table>

C.   <th>

D.   <td>

12: XHTML is HTML defined as what type of application?

A.   XML

B.   SASS

C.   XHAML

D.   XSLT

13: Scripts should be loaded where?

A.   <head></head>

B.   <footer></footer>

C.   <base>

D.   <body>

14: Which of the following is valid XHTML?

A.   <p class=bodyPara>Foo bar!</p>

B.   <P class=bodyPara>Foo bar!</P>

C.   <P class="bodyPara">Foo bar!</P>

D.   <p class="bodyPara">Foo bar!</p>

15: Which element is correctly formatted XHTML?

A.   </li>Two<li>

B.   <UL>Three</UL>

C.   <td ROWSPAN="3">Four</td>

D.   <li>One</li>

16: Choose the correct XHTML break tag from the following:

A.   <BR>

B.   <br />

C.   <break />

17: What does it mean to say that an XHTML document is "well-formed"?

A.   It only uses Unicode characters.

B.   It has all the required elements in the required order.

C.   Every tag that opens, closes.

D.   All of these.

18: Which of the following is "well-formed" XHTML format?

A.   <div id=

B.   <div id=

C.   <div id:groovy>Ain't it?</div>

D.   <div id=groovy>Ain't it?</div>

19: What is the proper syntax for a horizontal line?

A.   <hl />

B.   <HR>

C.   <hline />

D.   <hr />

20: What does the attribute "href" specify?

A.   text

B.   coordinates

C.   URL

D.   _blank

21: What is the correct usage of a well formed heading tag?

A.   <i><h3>Heading</h3></i>

B.   <strong><h3>Heading</strong></h3>

C.   <h3><i>Heading</h3></i>

D.   <h3>Heading</h3>

22: What is the proper tag for comments in XHTML?

A.   ?comment?

B.   <!--comment-->

C.   //comment

D.   /*comment*/

23: What does <strong> tag do to text?

A.   bold

B.   sentence case

C.   capitalize

D.   lowercase

24: Which of the following will set up a numbered list?

A.   <ol> <li>One</li> <li>Two</li> <li>Three</li> </ol>

B.   <dl> <li>One</li> <li>Two</li> <li>Three</li> </dl>

C.   <nl> <li>One</li> <li>Two</li> <li>Three</li> </nl>

25: The correct tag for defining a table row is:

A.   <row>

B.   <tr>

C.   <thead>

D.   <th>

A.   <a href="email:joe@domain.com">joe@domain.com</a>

B.   <a href="joe@domain.com">joe@domain.com</a>

C.   <a href="mail:joe@domain.com">joe@domain.com</a>

D.   <a href="mailto:joe@domain.com">joe@domain.com</a>

A.   <A CLASS="link" HREF="page.html">Link</A>

B.   <a class="link" href="page.html">Link</a>

C.   <A ID="link" HREF="page.html">Link</A>

D.   <a class=link href=page.html>Link</a>

28: The DOCTYPE declaration is required:

A.   In XHTML 1.0 Frameset

B.   In XHTML 1.0 Strict

C.   In XHTML 1.0 Transitional

D.   All of these

29: Which of these elements are form elements?

A.   All of these

B.   select

C.   textarea

D.   input

30: Which of the following is the correct way to use a paragraph in XHTML?

A.   <p></P>

B.   <P></P>

C.   <P></p>

31: Which of the following are correctly formatted?

A.   <ul><li><p>Some content</li>

B.   <ul><li><p>Some content

C.   <ul><li><p>Some content</ul></li>

D.   <ul><li><p>Some content</p></li></ul>

A.   javascript

B.   stylesheet

C.   document

D.   resources

33: What does DOM stand for?

A.   document object model

B.   document omission model

C.   dubious object mystery

D.   document order measurement

34: What's the right way to write a comment in XHTML?

A.   <!*-- ... --*>

B.   <? ... ?>

C.   <![CDATA[ .... ]]>

D.   <!-- ... -->

35: Which XHTML has properly nested elements?

A.   <p><i>Here is some text

B.   <div><b>Here is some text</div></b>

C.   <p><b>Here is some text</p></b>

D.   <p><i>Here is some text</i></p>

36: Which of the following creates a button?

A.   <input button value="Hello world!">

B.   <input type=button value=Hello world!>

C.   <input type="btn" value="Hello world!">

D.   <input type="button" value="Hello world!">

37: What tag is used to create a table row?

A.   <tr>

B.   <th>

C.   <table>

D.   <td>

38: What is the primary difference between HTML and XHTML?

A.   XHTML lets you create new elements of your own.

B.   XHTML is older.

C.   XHTML documents must be well-formed and valid according to the XHTML schema.

D.   XHTML documents must be in English.

39: How many levels of the heading tag (

,

, etc.) are allowed in XHTML?

A.   3

B.   10

C.   4

D.   6

40: What does XHTML stand for?

A.   Extra hypertext markup language

B.   Extendable hypertext model language

C.   Extensible hypertext markup language

D.   Exit hypertext markup language

41: Which of these is a well-formed input field?

A.   <input type=text name=name id=id />

B.   <input type="text" name="name" id="id" />

C.   <input type="text" name="name" id="id">

42: XHTML elements should always be written in:

A.   minimized form

B.   lower case

C.   capital case

D.   sentence case

43: What is the 'alt' attribute use for?

A.   To specify alternative image for a broken link

B.   To alternate between two images

C.   To specify alternative text for an image

D.   To specify alternative link for an image

44: In XHTML the correct method of defining a meta tag is:

A.   <meta name="description" content="My Website">

B.   <meta name="description" content="My Website" />

C.   <meta name=description content=My Website>

D.   <meta name="description" content=My Website>

45: Who wrote the current XHTML standard?

A.   The World Wide Web Consortium (W3C)

B.   DARPA

C.   The Web HyperText Application Technology Working Group (WHAT-WG)

D.   Tim Berners-Lee

46: Which of these is a correct application of a class?

A.   <span class="class">span</span>

B.   <img class=class src=image.jpg />

C.   <h2 class=class>span</h2>

D.   <class="class">span</>

47: What XHTML DTD is used most often?

A.   Strict

B.   Frameset

C.   Transitional

D.   Loose

48: What does DTD stand for?

A.   document type declaration

B.   decent type document

C.   definition type development

D.   document time definition

49: What tag is used to store the description of the document?

A.   <html>

B.   <head>

C.   <body>

D.   <meta>

50: Which of the following is the correct way to start a new line in XHTML?

A.   <p>

B.   <br />

C.   <li>