Logical elements, such as strong, convey meaning and add styling to text and are
therefore preferred. These will be covered in Chapter 3.
THE ESSENTIAL GUIDE TO CSS AND HTML WEB DESIGN
8
The preceding lines should be written like this:
This is a paragraph.
This is another paragraph.
Unlike HTML, all XHTML elements require an end tag, including empty elements (such as
br, img, and hr). The HTML for a carriage return is br. In XHTML, this must be written
or, more usually, in a combination form that looks like this:
. The trailing
slash is placed at the end of the start tag, with a space prior to it (now typical practice, this
was initially done to ensure compatibility with aging browsers that would otherwise ignore
the tag entirely if the space wasn??™t present).
Tags often have attributes that modify them in some way. For instance, two attributes for
the table cell tag td are nowrap (to stop content wrapping) and colspan (which states how
many columns this cell should span). In XHTML, attributes must be quoted and always
have a value. If necessary, the attribute name itself is repeated for the value. Therefore, the
following is incorrect:
Instead, in XHTML, we write this:
| Evolution is another aspect that we have to deal with. Just as the survival of the fittest removes some species from nature, so too are tags (and attributes) unceremoniously dumped from the W3C specifications.
Pages:
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|