Assignment 2

4.1 State whether each of the following is true or false. If false, explain why
a) An ordered list cannot be nested inside an unordered list. False: An ordered list can be nested inside an unordered list.
b) XHTML is an acronym for XML HTML. True
c) Element br represents a line break. True
d) Hyperlinks are denoted by link elements. False: Hyperlinks are denoted by anchor elements.
e) The width of all data cells in a table must be the same. False: The width of data cells in a table can vary using the colspan attribute.
f) You are limited to a maximum of 100 internal links per page. False: There is no limit to the number of internal links per page.

4.2 Fill in the blanks for each of the following.
a) The hr element inserts a horizontal rule.
b) A superscript is marked up using element sup and a subscript is marked up using element sub.
c) The least important heading element is h6 and the most important heading element is h1.
d) Element ul marks up an unordered list.
e) Element p marks up a paragraph.
f) The reset attribute in an input element inserts a button that clears the contents of the form.
g) The tr element marks up a table row.
h) Asterisks are usually used as masking characters in a password box.

4.3

4.4 Why is the following markup invalid?

Here is some text...


And some more text...

The markup is invalid because the first paragraph is not closed.

4.5 Why is the following markup invalid?

Here is some text...
And some more text...

The markup is invalid because the text in line two is not properly indented.

4.6 a) 4.6 b) 4.6 c)

4.7 a) 4.7 b) 4.7 c) 4.7 d) 4.7 e)

4.8
Create an XHTML document containing three ordered lists:
ice cream, soft serve and frozen yogurt. Each ordered list
should contain a nested, unordered list of your favorite flavors.
Provide a minimum of three flavors in each unordered list.

4.9
Create an XHTML document that uses an image as an email link.
Use attribute alt to provide a description of the image and link.

4.10
Create an XHTML document that contains links to your favorite websites.
Your page should contain the heading "My Favorite Websites"

4.11
Create an XHTML document that contains an unordered list with links
to all the examples presented in this chapter.

4.12 Identify each of the following as either an element or an attribute
a) html: Element
b) width: Attribute
c) href: Element
d) br: Element
e) h3: Attribute
f) a: Element
g) src: Attribute

4.13 State which of the following statements are true and which are false. If false explain why.
a) A valid XHTML document can contain uppercase letters in element names. False: Uppercase letters in element names is a syntax error.
b) Tags need not be closed in a valid XHTML document. False: All tags must be closed for an XHTML document to be valid.
c) XHTML documents can have the file extension .htm. True.
d) Valid XHTML documents can contain tags that overlap. False: A nested element's end tag must appear before the enclosing element's end tag.
e) &less; is the character entity reference for the less-than character. False: The character entity reference for less-than is <.
f) In a valid XHTML document, list item can be nested inside either ordered list or unordered list tags. True.

4.14 Fill in the blanks in each of the following.
a) XHTML comments begin with .
b) In XHTML, attribute values must be enclosed in quotation marks.
c) & is the character entity reference for an ampersand.
d) Element strong can be used to bold text.

4.15 Categorize each of the following as an element or an attribute:
a) width: attribute.
b) td: element.
c) th: element.
d) name: attribute.
e) select: element.
f) type: attribute.

4.16
Create the XHTML markup that produces the table shown in Fig. 4.16.
Use em and strong tags as necessary.

4.17
Write an XHTML document that produces the table shown in Fig. 4.17.

4.18
Create an XHTML document that allows prospective students to
provide feedback about their campus visit.

4.19
Create an XHTML document titled "How to Get Good Grades."
Use meta tags to include a series of keywords that describe your document.

Home