TECH 64095

Josh Talbott

Quiz 2

Chapter 4

4.4 Why is the following markup invalid?

                <p>Here is some text…

                <hr />

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

The code is invalid because it doesn’t end the first “<p>” before using a horizontal rule.  It is missing a </p>.

4.5 Why is the following markup invalid?

                <p>Here is some text…<br>

                And some more text…</p>

The code is invalid because I should end the first line with a “</p>” before the <br> then start and end the second line with a “<p>”,”</p>” repectively.

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

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

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

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

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 Presidents’s e-mail address (president@whitehouse.gov).

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

<p><a href = “../files/index.html”>Link 1</a></p>

<p><a href = “../files/text/index.html”>Link 2</a></p>

<p><a href = “../other/index.html”>Link 3</a></p>

<a href = mailto:president@whitehouse.gov>

Email President

</a>

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 e-mail link.  Use the 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 Web Sites”

4.11 Create an XHTML documents 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.  All element names are lowercase.

                b) Tags need not be closed in a valid XHTML document.  False.  Tags must have a start <> and end </>.

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

                d) Valid XHTML documents can contain tags that overlap.  True.

                e) &less; is the character entity reference for the less-than (<) character.  False. It’s “&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 “”.

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

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

4.16 Create the XHTML markup that produces the table shown in Fig. 4.16.  Use <em> and <strong> tags as necessary.  The image (camel.gif) is included in the Chapter 4 examples directory that can be downloaded from http://www.deitel.com/books/iw3htp4/.

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