Workshop


You've learned a lot today, and the following workshop will help you remember some of the most important points. I've anticipated some of the questions you might have in the first section of the workshop.

Q&A

Q

In some web pages, I've noticed that the page structure tags (<html>, <head>, <body>) aren't used. Do I really need to include them if pages work just fine without them?

A

Most browsers handle plain HTML without the page structure tags. The XHTML 1.0 recommendation requires that these tags appear in your pages. It's a good idea to get into the habit of using them now. Including the tags allows your pages to be read by more general SGML tools and to take advantage of features of future browsers. And, using these tags is the correct thing to do if you want your pages to conform to true HTML format.

Q

My glossaries came out formatted really strangely! The terms are indented farther in than the definitions!

A

Did you mix up the <dd> and <dt> tags? The <dt> tag is always used first (the definition term), and the <dd> follows (the definition). I mix them up all the time. There are too many d tags in glossary lists.

Q

I've seen HTML files that use <li> outside a list structure, alone on the page, like this:

<li>And then the duck said, "put it on my bill"</li>


A

Most browsers at least accept this tag outside a list tag and format it either as a simple paragraph or as a nonindented bulleted item. According to the true HTML specification, however, using an <li> outside a list tag is illegal, so good HTML pages shouldn't do this. Enclosing list items within list tags is also required by the XHTML recommendation. Always put your list items inside lists where they belong.

Quiz

1.

What three HTML tags are used to describe the overall structure of a web page, and what do each of them define?

2.

Where does the <title> tag go, and what is it used for?

3.

How many different levels of headings does HTML support? What are their tags?

4.

Why is it a good idea to use two-sided paragraph tags, even though the closing tag </p> is optional in HTML?

5.

What two list types have been deprecated? What can you use in place of the deprecated list types?

Quiz Answers

1.

The <html> tag indicates that the file is in the HTML language. The <head> tag specifies that the lines within the beginning and ending points of the tag are the prologue to the rest of the file. The <body> tag encloses the remainder of your HTML page (text, links, pictures, and so on).

2.

The <title> tag is used to indicate the title of a web page in a browser's bookmarks, hotlist program, or other programs that catalog web pages. This tag always goes inside the <head> tags.

3.

HTML supports six levels of headings. Their tags are <h1 .. /h1> through <h6 .. /h6>.

4.

The closing </p> tag becomes important when aligning text to the left, right, or center of a page (text alignment is discussed in Lesson 6, "Formatting Text with HTML and CSS"). Closing tags also are required for XHTML 1.0.

5.

The <menu> and <dir> list types have been deprecated in favor of using bulleted or unordered lists, <ul>.

Exercises

1.

Using the Camembert Incorporated page as an example, create a page that briefly describes topics that you would like to cover on your own website. You'll use this page to learn how to create your own links tomorrow.

2.

Create a second page that provides further information about one of the topics you listed in the first exercise. Include a couple of subheadings (such as those shown in Figure 4.2). If you feel really adventurous, complete the page's content and include lists where you think they enhance the page. This exercise will also help prepare you for tomorrow's lesson.




Sams Teach Yourself Web Publishing with HTML and CSS in One Hour a Day
Sams Teach Yourself Web Publishing with HTML and CSS in One Hour a Day (5th Edition)
ISBN: 0672328860
EAN: 2147483647
Year: 2007
Pages: 305

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net