HTML and CSS Reference
In-Depth Information
The second layer is the presentation layer , which is the core focus of this topic. It describes
how your document will be presented to the visitor, including such details as layout, typography,
colors, decorative images, and even nonvisual presentations like the voice family a screen
reader may use. Generally, the presentation layer of a web document is written using CSS.
Besides these two layers, you'll also find references to the behavior layer of a web docu-
ment. We don't discuss this layer in depth, but you should understand that it refers to using
scripting (usually JavaScript for manipulating the Document Object Model, or DOM) to
update, add, or remove items from the document based on the user's behavior.
Note For more information about JavaScript and the DOM, check out Beginning JavaScript with DOM
Scripting and Ajax:From Novice to Professional, by Christian Heilmann (Apress, 2006, ISBN 1590596803).
For a simple example of how the three layers work in conjunction with one another,
consider a basic “contact us” form on a company's web site. The form itself is marked-up text,
produced in (X)HTML. That text is then styled into the aesthetic presentation you see on screen
using CSS. After you fill out the form and click the Submit button, JavaScript steps in to vali-
date your input and lets you know that you skipped a required field. After you fix that oversight,
you hit Submit again. JavaScript then disables the button and displays a simple animation to
let you know something is happening before returning a message such as “Thank you! We'll
get back to you as soon as possible.”
In this chapter, we've covered the basics of modern (X)HTML markup. Because CSS expects
you to have written clean, valid, and semantic markup for your documents, it's essential to
have this piece of the equation in great shape before moving on to the presentation layer of
your page or site. Many CSS headaches can be solved simply by getting your (X)HTML right.
Speaking of CSS, let's move on to Chapter 2, where we'll cover the basics of what CSS is and
how it works.
Search WWH ::

Custom Search