Chapter 4

4.4 Why is the following markup invalid?

<p>Here is some text…

<hr />

<p>And some more text…</p>

It does not have </p> after "...".

4.5 Why is the following markup invalid?

<p>Here is some text…<br>

And some more text…</p>

It has to end with a "</p>" before the <br>. There should be "<p>" before "And".

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. Elements should be lowercase.

b) Tags need not be closed in a valid XHTML document. False. It should have corresponding closing tags.

c) XHTML documents can have the file extension .htm True.

d) Valid XHTML documents can contain tags that overlap. False. It cannot contain tags that overlap.

e) &less; is the character entity reference for the less-than (<) character. False. The correct on should be"&lt".

f) In a valid XHTML document, <li> can be nested inside either <ol> or <ul> tags. True

4.14 Fill in the blanks in each of the following:

a) XHTML comments begin with <!—and end with "-->".

b) In XHTML, attribute values must be enclosed in quotes.

c) "&amp" is the character entity reference for an ampersand.

d) Element <strong> can be used to bold text.

4.15 Categorized each of the following as an element or attribute:

a) width Attribute

b) td Element

c) th Element

d) name Attribute

e) select Element

f) type Attribute

aaaaaaaaaaaaiii