Elance XHTML Test Answers 2015



Which of these is well formed?
<body>
<BODY>
<Body>


What's the most common XHTML DTD?
Quirks
Strict
Transitional
Standard


Which of the following elements cannot go in the <head> tag
<meta>
<header>
<link>
<title>


In XHTML the correct method of defining a meta tag is:
<meta name="description" content=My Website>
<meta name=description content=My Website>
<meta name="description" content="My Website" />
<meta name="description" content="My Website">


Which element is correctly formatted XHTML?
</li>Two<li>
<td ROWSPAN="3">Four</td>
<li>One</li>
<UL>Three</UL>


Which of these elements are form elements?
select
All of these
textarea
input


What does it mean to say that an XHTML document is 'well-formed'?
All of these.
It only uses Unicode characters.
Every tag that opens, closes.
It has all the required elements in the required order.


Which of these links will validate in XHTML 1.0 Strict?
<A CLASS="link" HREF="page.html">Link</A>
<a class="link" href="page.html">Link</a>
<A ID="link" HREF="page.html">Link</A>
<a class=link href=page.html>Link</a>


What does the attribute 'href" specify?
text
_blank
URL
coordinates


What does <strong> tag do to text?
capitalize
bold
sentence case
lowercase


Which of the following is the correct way to use a paragraph in XHTML?
<p></P>
<P></p>
<p></p>
<P></P>


Which of the following are correctly formatted?
<ul><li><p>Some content
<ul><li><p>Some content</ul></li>
<ul><li><p>Some content</li>
<ul><li><p>Some content</p></li></ul>


The correct tag for defining a table row is:
<thead>
<th>
<row>
<tr>


What is the proper tag for comments in XHTML?
/*comment*/
<!--comment-->
?comment?
//comment


Which of the following is 'well-formed' XHTML format?
<div id=groovy>Ain't it?</div>
<div id:groovy>Ain't it?</div>
<div id="groovy">Ain't it?
<div id="groovy">Ain't it?</div>


The <title> tag goes inside what tag?
<body></body>
<head></head>
<footer></footer>
<html></html>


What is the proper syntax for a horizontal line?
<HR>
<hr />
<hline />
<hl />


Which is the correct value for an email link?
<a href="email:joe@domain.com">joe@domain.com</a>
<a href="joe@domain.com">joe@domain.com</a>
<a href="mail:joe@domain.com">joe@domain.com</a>
<a href="mailto:joe@domain.com">joe@domain.com</a>


What is the correct usage of a well formed heading tag?
<i><h3>Heading</h3></i>
<h3>Heading</h3>
<strong><h3>Heading</strong></h3>
<h3><i>Heading</h3></i>


The DOCTYPE declaration is required:
In XHTML 1.0 Frameset
In XHTML 1.0 Transitional
All of these
In XHTML 1.0 Strict


What does DOM stand for?
document order measurement
document object model
document omission model
dubious object mystery


Which of the following will set up a numbered list?
<dl> <li>One</li> <li>Two</li> <li>Three</li> </dl>
<ol> <li>One</li> <li>Two</li> <li>Three</li> </ol>
<nl> <li>One</li> <li>Two</li> <li>Three</li> </nl>


Choose the correct XHTML break tag from the following:
<break />
<BR>
<br>
<br />


What tag is used to create a table row?
<th>
<tr>
<table>
<td>


Fill in the blank for the 'rel' attribute used in the following: <link href="source.css" type="text/css" rel="__"
stylesheet
javascript
resources
document


Which of the following creates a button?
<input button value="Hello world!">
<input type=button value=Hello world!>
<input type="btn" value="Hello world!">
<input type="button" value="Hello world!">


Which XHTML has properly nested elements?
<p><i>Here is some text
<p><i>Here is some text</i></p>
<div><b>Here is some text</div></b>
<p><b>Here is some text</p></b>


Which of the following is valid XHTML?
<P class=bodyPara>Foo bar!</P>
<p class=bodyPara>Foo bar!</p>
<p class="bodyPara">Foo bar!</p>
<P class="bodyPara">Foo bar!</P>


What is the special character value for an non-breaking space?
&space;
&nbsp;
&amp;
&quot;


What's the right way to write a comment in XHTML?
<!-- ... -->
<? ... ?>
<!*-- ... --*>
<![CDATA[ .... ]]>


What is the primary difference between HTML and XHTML?
XHTML documents must be well-formed and valid according to the XHTML schema.
XHTML lets you create new elements of your own.
XHTML documents must be in English.
XHTML is older.


Who wrote the current XHTML standard?
Tim Berners-Lee
The World Wide Web Consortium (W3C)
The Web HyperText Application Technology Working Group (WHAT-WG)
DARPA


What does XHTML stand for?
Exit hypertext markup language
Extendable hypertext model language
Extensible hypertext markup language
Extra hypertext markup language


XHTML is HTML defined as what type of application?
XHAML
SASS
XSLT
XML


Scripts should be loaded where?
<base>
<body>
<footer></footer>
<head></head>


Which of these are well-formed nesting?
All of these
<p><strong>Hello!</p></strong>
<h1><div>Goodbye!</h1></div>
<div><h1>Goodbye!</h1></div>


How many levels of the heading tag (<h1>,<h2>, etc.) are allowed in XHTML?
3
4
6
10


XHTML elements should always be written in:
sentence case
lower case
minimized form
capital case


What is the 'alt' attribute use for?
To specify alternative image for a broken link
To specify alternative text for an image
To specify alternative link for an image
To alternate between two images


Which of these is a well-formed input field?
<input type="text" name="name" id="id">
<input type=text name=name id=id />
<input type="text" name="name" id="id" />


Which of these is a correct application of a class?
<class="class">span</>
<span class="class">span</span>
<img class=class src=image.jpg />
<h2 class=class>span</h2>


What does DTD stand for?
definition type development
document type declaration
document time definition
decent type document


What tag is used to store the description of the document?
<meta>
<head>
<html>
<body>


Which type attribute minimization is allowed in XHTML?
<input checked>
Attibute minimization is not allowed in XHTML
<dl compact>
<input button>


What XHTML DTD is used most often?
Strict
Frameset
Loose
Transitional


The correct tag for defining a table header cell is:
<header>
<td>
<th>
<table>


What does XSLT stand for?
Extra Stylesheet Language Transformations
Exotic Style Language Text
Extra Semblege Language Transformations
Extensible Stylesheet Language Transformations


Which of the following is the correct way to start a new line in XHTML?
<p>
<br>
<br />
<li>


Which is NOT an acceptable XHTML DOCTYPE?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html>


To set parameters within the object tag, you would use which tag?
<parameter>
<param>
<code>
<option>


Which of the following is valid XHTML?
<body><p><b>Ferret!</b></p><p>Another ferret!</b></p></body>
<Body><p><b>Ferret!</b></p><p>Another ferret!</p></Body>
<body><p><b>Ferret!</b></p><p>Another ferret!</p></body>
<body><p><b>Ferret!</p><p>Another ferret!</b></p></body>


Which is the correct method of including an inline style?
<div class="good-morning"><h1 style="margin: 0; padding: 0;">Good morning!</h1></div>
<div class="margin: 0; padding: 0;"><h1>Good morning!</h1></div>
<div class="good"><h1 style="morning">Good morning!</h1></div>
<div class="good-morning"><h1>Good morning!</h1></div>


What is the correct value for opening a link in a new window?
target="_new"
open="_window"
target="_top"
open="new"


How is the default namespace usually included on an XHTML document?
<html xmlns="http://www.w3.org/1999/xhtml">
<html xmlns:xhtml="http://www.w3.org">
<html>
<html xml:lang="en">


The XML namespace attribute is mandatory in:
XHTML 1.0 Transitional
XHTML 1.0 Frameset
XHTML 1.0 Strict
All of these


Which is NOT a valid value for the 'target' attribute?
_inner
_top
_self
_blank


Which of these is an inline element by default?
div
h1
span
fieldset


What is the correct formatting for including JavaScript?
<script type="text/javascript" language="javascript">
<script type="text/javascript"></script>
<script type="text/javascript" language="javascript" />
<script type="text/javascript" />


Which of these, by default, is a block-level element?
span
strong
p
em


In the opening form tag, which is a mandatory attribute?
accept
title
action
enctype


Which is the correct formatting of an object tag?
<object type="application/x-shockwave-flash" data="silly.swf" width="700" height="500"></object>
<object type=application/x-shockwave-flash data=silly.swf width=700 height=500 />
<object type=application/x-shockwave-flash data=silly.swf width=700 height=500></object>
<object type="application/x-shockwave-flash" data="silly.swf" width="700" height="500" />


Which of these is the correct XHTML usage of the Language attribute?
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<html lang="en">
<meta xml:lang="en">


Which of these is a valid conditional statement to target all versions of IE.
<!--[if IE 7]> <link href="styles.css" rel="stylesheet"/> <![endif]-->
<!--[if !IE]><!--> <link href="styles.css" rel="stylesheet"/> <!--<![endif]-->
<!--[if IE]> <link href="styles.css" rel="stylesheet"/> <![endif]-->


What are the required elements for XHTML documents?
<html>, <doctype>, <body>
<html>, <head>, <footer>
<html>, <head>, <title>, <body>
<html>, <style>, <title>, <body>


Which browser does NOT support XHTML?
Internet Explorer 8
Safari
Internet Explorer 9
Firefox


Which of the following is a correct processing instruction?
<!-- xml version="1.0" encoding="UTF-8" -->
<?xml version=1.0 encoding=UTF-8?>
<!-- xml version=1.0 encoding=UTF-8 -->
<?xml version="1.0" encoding="UTF-8"?>


What tag is used to define italics besides <i>?
<it>
<em>
<emphasis>
<italic>


Which is the correct XHTML for empty elements?
Get the net <*img src="net.jpg">
Go fly a kite<hr />
Go fly a plane</hr>
Cool your jets<.br>


What is the correct usage of the label element?
<form method="post" action="action.php"> <label>Name</label> <input type="text" name="name" id="name" /> </form>
<form method="post" action="action.php"> <label for="name">Name</label> <input type="text" /> </form>
<form method="post" action="action.php"> <label for="name">Name</label> <input type="text" name="name" id="name" /> </form>


Which of the following is NOT one of the DTD's for XHTML?
Quirks
Strict
Transitional
Frameset


Which of the following is the correct document structure?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Title</title> </head> <body> </body> </html>
<html xmlns="http://www.w3.org/1999/xhtml"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd> <head> <title>Title</title> </head> <body> </body> </html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd> <html xmlns="http://www.w3.org/1999/xhtml"> <title>Title</title> <head> </head> <body> </body> </html>


Which of these is correct application of an anchor link?
<a href="#link">Link</a> <div class="link">Here</div>
<a href="#link">Link</a> <div id="link">Here</div>
<a href="#link">Link</a> <div class="link">Here</div>
<a href="link">Link</a> <div id="link">Here</div>


Which is the correct method of defining the default option that's in the select group?
<select name="list" id="list"> <option value="1" >One</option> <option value="2">Two</option> <option value="3" selected="selected">three</option> </select>
<select name="list" id="list"> <option value="1" selected>One</option> <option value="2">Two</option> <option value="3">three</option> </select>
<select name="list" id="list"> <option value="1" selected>One</option> <option value="2" selected>Two</option> <option value="3" selected>three</option> </select>


What would you put inside of a <![CDATA[ .... ]]> element?
A comment.
Text that contains characters that would otherwise need to be escaped.
Links to external documents.
Data that is to be calculated.


In which tag do you define the XML namespace?
<head>
<html>
<base>
<footer>


Which of the following is a well formed table?
<table> <tr> <td colspan="2">Cell</td> <td colspan="2">Cell</td> </tr> <tr> <td colspan="2">Cell</td> </tr> </table>
<table> <tr> <td>Cell</td> <td>Cell</td> </tr> <tr> <td>Cell</td> </tr> </table>
<table> <tr> <td>Cell</td> <td>Cell</td> </tr> <tr> <td colspan="2">Cell</td> </tr> </table>


Which DOCTYPE does not include deprecated elements(i.e. <font>)?
Transitional
Frameset
Original
Strict


Which of these are the correct structure of a definition list?
<dl> <dt>Car</dt> <dd>Convertible</dd> </dl>
<dt> <dl>Car</dl> <dd>Convertible</dd> </dt>
None of these
<dt> <dl>Car</dl> <dd>Convertible</dd> </dt>


To reload or redirect a page in a specified amount of time in XHTML, you would use which of the following?
<meta http-equiv="refresh" content="2;url=http://www.google.com/" />
<meta http-equiv="refresh" content="2;url=http://www.google.com/">
<meta http-equiv="reload" content="url=http://www.google.com/" />
<meta http-equiv="reload" content="2">


The <base> tag goes inside what tag?
<head></head>
<html></html>
<body></body>
<footer></footer>


Which of these frame references is a well formed 2 column frame?
<frameset cols="33%,33%,33%"> <frame src="frame-1.html"> <frame src="frame-2.html"> <frame src="frame-3.html"> </frameset>
<frameset cols="50%,50%"> <frame src="frame-1.html"> <frame src="frame-2.html"> </frameset>
<frameset> <frame cols="50%" src="frame-1.html"> <frame cols="50%" src="frame-2.html"> </frameset>


Which tag has NOT been deprecated with XHTML?
<embed>
<basefont>
<textarea>
<strike>


Which of the following is NOT a benefit of using XHTML?
A browser will render it, even with errors.
It keeps your data to a consistent standard to ensure interoperability.
It ensures that all of your documents are machine-readable.
It expands the potential for the semantic web.


Which DOCTYPE does include deprecated elements(i.e. <font>)?
Transitional
Flexible
Strict
Frameset


Which of the following is something you can do in XHTML that you can't do in HTML?
Manipulate the DOM with JavaScript
Utilize external stylesheets
Include comments
Include processing instructions


What is a namespace?
The way we refer to the list of elements provided in a given document
A predicate that is used to make a set of elements unique and avoid conflict
Another word for a DTD
A set of allowable attributes for an element


What is the difference between the @name and @id attributes?
Selecting via @name is faster.
You only use @name on <form> elements; you can use @id on any element.
HTML references elements by @name; XHTML can only reference elements by @id.
There is no difference.


Which of these image attributes are NOT supported?
usemap
hspace
ismap
action


How do XPath statements vary between HTML and XHTML?
You cannot use XPath to search HTML documents.
The namespace is almost always required in HTML.
You cannot use XPath to search XHTML documents.
The namespace is almost always required in XHTML.


Attribute 'name' has been replaced with what attribute for the following elements: a, iframe, img?
id
src
title
class


When referencing an image map, what attribute is assigned to the image?
alt
src
crossorigin
ismap


Which tag has NOT been deprecated with XHTML?
<font>
<u>
<menu>
<hr>


To embed an iframe on a web page, you would use which method?
<iframe class="iframe-video" src="video.mp3"></iframe>
<embed width="600" height="400" src="video.mp3" />
<iframe width="600" height="400" src="video.mp3" />
<embed width="600" height="400" src="video.mp3"></embed>


The correct method for including a stylesheet is:
<style type="text/css" media="all"> #style { color: #000; } </style>
<style type="text/css" media="all"> @import url("styles.css"); </style>
<link rel="stylesheet" type="text/css" href="styles.css">
All of these are correct


What is the minimum sufficient XHTML document, not including declarations?
<html><head></head><body></body></html>
<HTML><head><title></title></head><body></body></HTML>
<html><head><title></title></head><body></body></html>
<html><head><title></title></head><body><p></p></body></html>


Why should you make sure empty elements have a space before the close (i.e., <br /> instead of <br/>)?
Without the space, a parser thinks that '/' is an attribute.
The space is necessary for the XML to be valid.
Some browsers read <br/> as declaring the element named "br/", which is nonsense.
All elements must have a space before the terminal '>' character.


Why shouldn't you treat normally non-empty elements as empty elements (i.e., why shouldn't you use '<p />')?
It makes it annoying to go back and edit the document since you have reformat the tag.
Paragraphs cannot be empty under the XHTML schema.
You are not adding any actual information to the document; it will clutter the display.
HTML parsers will think you are declaring the element named 'p /', which is nonsense.


Which is a correctly formatted nested bulleted list?
<ul> <li>Planes <ul> <li>Red</li> <li>White</li> <li>Blue</li> </ul> <li>Trains</li> <li>Automobiles</li> </ul>
<ul> <li>Planes <ul> <li>Red</li> <li>White</li> <li>Blue</li> </ul> </li> <li>Trains</li> <li>Automobiles</li> </ul>
<ul> <li>Planes</li> <ul> <li>Red</li> <li>White</li> <li>Blue</li> </ul> <li>Trains</li> <li>Automobiles</li> </ul>


What is the best practice for italicizing content?
<i>content</i>
<italic>content</italic>
<p style="font-style:italic">content</p>
<i>content


In unicode support, what's the difference between XHTML 1.1 and HTML 4.01?
HTML supports all unicode characters and non-characters; XHTML only accepts a few.
Neither has particularly robust unicode support, but XHTML has more.
HTML supports all unicode characters and non-characters; XHTML has a few restrictions.
There is no difference; they both accept all unicode characters and non-characters.


How many parsing modes does XHTML have?
Three
Two
Four
One


What is a correct document type declaration for XHTML?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" xmlns="http://www.w3.org/1999/xhtml">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<!DOCTYPE html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">


What is the difference between XHTML and HTML regarding whitespace?
There is no difference; in both, all spans of whitespace are preserved.
In XHTML, all spans of whitespace are shortened to a single space; in HTML, they are preserved
In XHTML, all spans of whitespace are preserved; in HTML, they are shortened to a single space
There is no difference; in both, all spans of whitespace are shortened to a single space.


Which of these is a correct <form> in XHTML?
"<form action="formSubmit" method="post"> Email: <input type="text" id="emailInput" /> Yes, subscribe me to your mailing list: <input type="checkbox" checked="checked" /> <input type="submit" value="Submit" /> </form>"
"<form action=formSubmit method=post> Email: <input type=text id=emailInput /> Yes, subscribe me to your mailing list: <input type=checkbox checked=checked /> <input type=submit value=Submit /> </form>"
"<form action="formSubmit" method="post"> Email: <input type="text" name="emailInput" /> Yes, subscribe me to your mailing list: <input type="checkbox" checked="checked" /> <input type="submit" value="Submit" /> </form>"
"<form action="formSubmit" method="post"> Email: <input type="text" id="emailInput" /> Yes, subscribe me to your mailing list: <input type="checkbox" checked /> <input type="submit" value="Submit" /> </form>"


What happens if you do not include the XHTML default namespace in the declaration?
The document will not be valid against the schema
All XHTML elements must be preceded by 'http://www.w3.org/1999/xhtml:'
The browser will not load the document
The browser will attempt to parse the document as HTML


Why doesn't the JavaScript command "document.write();" work in XHTML?
Because it's intended for console logging
It results in malformed documents
You cannot manipulate an XHTML document with JavaScript
Browsers don't agree on how to render it


What is wrong with this doctype declaration? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>
It does not contain an @xml:lang attribute.
There should be a space before the closing tag.
It does not include the default namespace.
The doctype declaration has no closing tag.


What is the most proper MIME type for an XHTML document?
application/xhtml+xml
text/html
text/xml
application/xhtml


What happens if you put an XHTML <![CDATA[ .... ]]> element in HTML?
The entire thing, including the "<![CDATA..." markup, is displayed.
It is treated as non-parsed character data and displayed literally.
It is ignored as an incorrectly-formatted comment.
You open the document up to security vulnerabilities, and as such the section is ignored.


Why is getting the MIME type correct important?
Without the correct MIME type, web crawlers won't know how to index your document
The server needs to know how to encode the characters
It isn't - modern browsers don't need it
If the browser doesn't know it's XHTML, then it won't work right


Which of the following character entities cannot be used in XHTML?
&lt;
&gt;
&apos;
&nbsp;


Which of the following is valid XHTML?
<span style="background-color: #abc;">Foo &gt; bar</span>
<span style="background-color: #abc;">Foo &nbsp; bar</span>
<span style=background-color: #abc;>Foo &gt; bar</span>
<span style="background-color: #abc;">Foo &amp; bar</span>


What is the primary difference between XHTML 1.0 and XHTML 1.1?
XHTML 1.1 includes Ruby annotations
XHTML 1.1 supports more namespaces
XHTML 1.0 lets you define your own entities
XHTML 1.0 doesn't allow processing instructions


What are the character encodings that are guaranteed to work properly for an XHTML document?
UTF-8
Unicode and ASCII
Unicode
UTF-8 and UTF-16


Which is a complete list of XHTML versions?
1.0, 1.1
1.0, 1.1, 5
1.0, 1.1, 4.1 Transitional
4.01 Transitional, 5


What is the correct formatting of a horizontal rule?
<rule>
<hr />
</ hr>
<hr>