Chapter 4 Assignments


Home

Section 4.1 - State whether each of the following is true or false. If false, explain why.

1. An ordered list cannot be nested inside an unordered list.
Answer: False. An ordered list can be nested inside an unordered list and vice versa.

2. XHTML is an acronym for XML HTML.
Answer: False. XHTML is an acronym for Extensible HyperText Markup Language.

3. Element br represents a line break.
Answer: True

4. Hyperlinks are denoted by link elements.
Answer: False. Hyperlinks are denoted by a elements.

5. The width of all data cells in a table must be the same.
Answer: False. You can specify the width of any column, either in pixels or as a percentage of the table width.

6. You are limited to a maximum of 100 internal links per page.
Answer: False. You can have an unlimited number of internal links.


Section 4.2 - Fill in the blanks in each of the following

1. The __________ element inserts a horizontal rule.
Answer: hr

2. A superscript is marked up using element __________ and a subscript is marked up using element __________.
Answer: •sup •sub

3. The least important heading element is __________ and the most important heading element is __________.
Answer: •h6 •h1

4. Element __________ marks up an unordered list.
Answer: ul

5. Element __________ marks up a paragraph.
Answer: p

6. The __________ attribute in an input element inserts a button that, when clicked, clears the contents of the form.
Answer: type = "reset"

7. The __________ element marks up a table row.
Answer: tr

8. __________ are usually used as masking characters in a password box.
Answer: asterisks


Section 4.3 - Create the following web page

Use XHTML to create a document that contains the following text:
Internet and 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.
Answer: Answer to 4.3


Section 4.4 - Answer the question.

Why is the following markup invalid?

        <p>Here is some text...
        <hr />
        <p>And some more text...</p>
        
Answer: The paragraph element is not closed.


Section 4.5 - Answer the question.

Why is the following markup invalid?

        <p>Here is some text...<br>
        And some more text...</p>
        
Answer: The line break element is not closed.


Section 4.6 - Perfrom the following

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 img element to perform each of the following transformations:
1. Increase the size of the image by 100 percent.
2. Increase the size of the image by 50 percent.
3. Change the width-to-height ratio to 2:1, keeping the width attained in part (a).
Answer: Answer to 4.6


Section 4.7 - Create a link to each of the following

1. The file index.html, located in the files directory.
Answer: index.html

2. The file index.html, located in the text subdirectory of the files directory.
Answer: index.html

3. The file index.html, located in the other directory in your parent directory.
Answer: index.html

4. The President’s e-mail address (president@whitehouse.gov).
Answer: Email the President!

5. The file named README in the pub directory of ftp.cdrom.com. [Hint: Use ftp://.]
Answer: cdrom.com pub README
While I created this link for the assignment, Walnet Creek, and ftp.cdrom.com is long dead.


Section 4.8 - Create the following web page

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.
Answer: Answer to 4.8


Section 4.9 - Create the following web page

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.
Answer: Answer to 4.9


Section 4.10 - Create the following web page

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


Section 4.11 - Create the following web page

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


Section 4.12 - Identify each of the following as either an element or an attribute

1. html
Answer: element

2. width
Answer: attribute

3. href
Answer: attribute

4. br
Answer: element

5. h3
Answer: element

6. a
Answer: element

7. src
Answer: attribute


Section 4.13 - State which of the following statements are true and which are false. If false, explain why.

1. A valid XHTML document can contain uppercase letters in element names.
Answer: False, In XHTML elements should be lowercase.

2. Tags need not be closed in a valid XHTML document.
Answer: False, In XHTML, ALL tags must be closed.

3. XHTML documents can have the file extension .htm.
Answer: True

4. Valid XHTML documents can contain tags that overlap.
Answer: False, in XHTML, tags cannot overlap.

5. &less; is the character entity reference for the less-than (<) character.
answer: False, &lt; is the less than character.

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


Section 4.14 - Fill in the blanks in each of the following

1. XHTML comments begin with <!-- and end with __________.
Answer: -->

2. In XHTML, attribute values must be enclosed in __________.
Answer: single or double quotes

3. __________ is the character entity reference for an ampersand.
Answer: &amp;

4. Element __________ can be used to bold text.
Answer: <b>, or most browsers will display <strong> as bold, but this may not always be the case.


Section 4.15 - Categorize each of the following as an element or an attribute

1. width
Answer: attribute

2. td
Answer: element

3. th
Answer: element

4. name
Answer: attribute

5. select
Answer: element

6. type
Answer: attribute


Section 4.16 - Create the following web page

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

Answer: Answer to 4.16


Section 4.17 - Create the following web page

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

Answer: Answer to 4.17


Section 4.18 - Create the following web page

A local university has asked you to create an XHTML document that allows prospective students to provide feedback about their campus visit. Your XHTML document should contain a form with text boxes for a name, address and e-mail. Provide checkboxes that allow prospective students to indicate what they liked most about the campus. The checkboxes should include: students, location, campus, atmosphere, dorm rooms and sports. Also, provide radio buttons that ask the prospective students how they became interested in the university. Options should include: friends, television, Internet and other. In addition, provide a text area for additional comments, a submit button and a reset button.
Answer: Answer to 4.18


Section 4.19 - Create the following web page

Create an XHTML document titled “How to Get Good Grades.” Use <meta> tags to include a series of keywords that describe your document.
Answer: Answer to 4.19