Kathleen Bowling

Home


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 and vice versa.

b) XHTML is an acronym for XML HTML. FALSE. XHTML is an acronym for Extensible HyperText Markup Language.

c) Element br represents a line break. TRUE.

d) Hyperlinks are denoted by link elements. FALSE. Hyperlinks are denoted by a elements.

e) The width of all data cells in a table must be the same. FALSE. You can specify the width of any column, either in pixels or as a percentage of the table width.

f) You are limited to a maximum of 100 internal links per page. FALSE. You can have an unlimited number of internal links.


4.2

Fill in the blanks in each of the following:

a) The hr element inserts a horizontal rule.

b) A superscript is marked up using element sup and a subscriptis marked 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 type= "reset" attribute in an input element inserts a button that, when clicked, clears the contents of a form.

g) The tr element marks up a table row.

h) Asterisks are usually used as masking characters in a password box.


4.3

Use XHTML to create a document that contains the following text:

Internet and the World Wide Web How to Program: Fourth Edition

Welcome to the world of Internet programming. We have provided

topical coverage for many Internet-related topics.


Use h1 for the title (the first line of text), p for text (the second and third lines of text) and sub for each word that begins with a capital letter (except the title). Insert a horizontal rule between the h1 element and the p element. Open your new document in a web browser to view the marked-up document.

Exercise 4.3


4.4

Why is the following markup invalid?

There is no end tag for the first <'p'> tag. There is also no start tag for the <'hr /'> tag.


4.5

Why is the following markup invalid?

There is no end tag for the <'br'> tag.


4.6

An image named deitel.gif is 200 pixels wide and 150 pixels high. Write an XHTML statement using the width and height attributes of the element to perform each of the following transformations:

a) Increase the size of an image by 100 percent.

<'img src= "deitel.gif" width= "400" height="300" /'>

b) Increase the size of an image by 50 percent.

<'img src= "deitel.gif" width= "300" height="225" /'>

c) Change the width-to-height ratio to 2:1, keeping the width attained in part (a).

<'img src= "deitel.gif" width= "400" height="200" /'>


4.7

Create a link to each of the following:

a) The file index.html, located in the files directory.

b) The file index.html, located in the text subdirectory of the files directory.

c) The file index.html, located in the other directory in your parent directory.

d) The President’s e-mail address (president@whitehouse.gov).

e) The file named README in the pub directory of ftp.cdrom.com.


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.

Exercise 4.8


4.9

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

Exercise 4.9


4.10

Create an XHTML document that contains links to your favorite websites. Your page should contain the heading “My Favorite Web Sites”.

Exercise 4.10


4.12

Identify each of the following as either an element or an attribute:

a) html= element

b) width= attribute

c) href= attribute

d) br= element

e) h3= element

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 an XHTML element name is a syntax error. Element names are all in lowercase letters.

b) Tags need not to be closed in a valid XHTML document. FALSE. Tags must be closed so that an element isn't applied to an entire document.

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

d) Valid XHTML documents can contain tags that overlap. FALSE. XHTML does not permit tags to overlap- a nested element's end tag must appear in the document before the enclosing element's end tag.

e) &less; is the character entity reference for the less-than (<) character.FALSE. the character entity for the less-than symbol (<) is & l t ;

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 start and end tags.

c) & a m p ; is the character entity reference for an ampersand.

d) Element <'b'> 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

Exercise 4.16


4.17

Exercise 4.17


4.18

Question 4.18


4.19

Exercise 4.19