< Day Day Up > |
Recall from Chapter 1 that HTML and XHTML are structured languages. All documents should start with a document type definition indicating the type of markup in use and then have a root html element that contains a <head> and <body> tag, or in some situations a <head> and <frameset> tag. Within the head of the document, information about the document such as its title, character set, style sheets, and scripts is indicated, while the <body> tag encloses the actual content of the page. An example structure for an XHTML 1.0 transitional document is shown here:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head> <title> Title here </title> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /> <!-- other head information here --> </head> <body> <!-- other body information here --> </body> </html>
Given the basic XHTML template, the italicized areas would be modified appropriately per document. All the following examples will continue on with this XHTML 1.0 transitional template except where noted. However, if you prefer to write markup to another specification, all the examples presented in the chapter can be found at the support site (www.htmlref.com) in HTML 4.0 transitional, HTML 4.01 strict with CSS, and XHTML 1 strict with CSS. Now that we have reminded ourselves of the overall document structure, it is time to explore the tags within the body of the document. But before we do that, we should talk about the aspects of these tags that are always similar: the core attributes.
< Day Day Up > |