Workshop


Here you are at the close of another day (a long one!) and facing yet another workshop. Today's lesson covered a lot of ground, so I'll try to keep the questions easy. There are a couple of exercises that focus on building some additional pages for your website. Ready?

Q&A

Q

If line breaks appear in HTML, can I also do page breaks?

A

HTML doesn't have a page break tag. Consider what the term page means in a web document. If each document on the Web is a single page, the only way to produce a page break is to split your HTML document into separate files and link them.

Even within a single document, browsers have no concept of a page; each HTML document simply scrolls by continuously. If you consider a single screen a page, you still can't have what results in a page break in HTML. The screen size in each browser is different. It's based on not only the browser itself, but also the size of the monitor on which it runs, the number of lines defined, the font currently being used, and other factors that you cannot control from HTML.

When you're designing your web pages, don't get too hung up on the concept of a page the way it exists in paper documents. Remember, HTML's strength is its flexibility for multiple kinds of systems and formats. Instead, think in terms of creating small chunks of information and how they link together to form a complete presentation.

If page breaks are essential to your document, you might consider saving it in the PDF format and making it available for download.

Q

How can I include em dashes or curly quotes (typesetter's quotes) in my HTML files?

A

There are entities for all of these characters, but they may not be supported by all browsers or on all platforms. Most people still don't use them. To add an em dash, use —. The curly quote entities are “ for the left quote and ” for the right quote. Similarly, you can create curly single quotes using ‘ and ’.

Quiz

1.

What are the differences between logical character styles and physical character styles?

2.

What are some things that the <pre> (preformatted text) tag can be used for?

3.

What's the most common use of the <address> tag?

4.

Older versions of HTML provided ways to align and center text on a web page. What's the recommended way to accomplish these tasks in HTML 4.01?

5.

Without looking at Table 6.2, list all eight logical style tags and what they're used for. Explain why you should use the logical tags instead of the physical tags.

Quiz Answers

1.

Logical styles indicate how the highlighted text is used (citation, definition, code, and so on). Physical styles indicate how the highlighted text is displayed (bold, italic, or monospaced, for example).

2.

Preformatted text can be used for text-based tables, code examples, ASCII art, and any other web page content that requires extra spaces to align characters.

3.

The <address> tag is most commonly used for signature-like entities on a web page. These include the name of the author of the web page, contact information, dates, copyright notices, or warnings. Address information usually appears at the bottom of a web page.

4.

Alignment and centering of text can be accomplished with style sheets, which is the recommended approach in HTML 4.01.

5.

The eight logical styles are <em> (for emphasized text), <strong> (for bold text), <code> (for programming code), <samp> (similar to <code>), <kbd> (to indicate user keyboard input), <var> (for variable names), <dfn> (for definitions), and <cite> (for short quotes or citations). Logical tags rely on the browser to format their appearance.

Exercises

1.

Now that you've had a taste of building your first really thorough web page, take a stab at your own home page. What can you include that would entice people to dig deeper into your pages? Don't forget to include links to other pages on your site.

2.

Try out your home page in several browsers and even on multiple platforms if you have access to them. Web developers have to get used to the fact that their designs are at the mercy of their users, and it's best to see right away how different browsers and platforms treat pages.




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