Use the W3C validator
for con?¬? rmation that all tags are correctly nested and therefore
your document is well-formed.
6. Inline tags can??™t contain block level tags. Block-level elements,
such as p (paragraph) and div (division), automatically organize
themselves one under the next down the page. If you have two
paragraphs, the second paragraph appears by default under the
previous one??”no line breaks are required. By contrast, inline
tags, such as a (anchor, a hyperlink) and em (emphasis, usually
displayed as italics) occur in the normal ?¬‚ ow of text, and don??™t
force a new line.
We discuss block and inline elements in detail later in Chapter
4, but for now, just remember that if you nest a block element,
such as a paragraph p, inside an inline element, such as a link a,
your code won??™t validate.
Also, some block-level elements can??™t contain other block-level
elements either; for instance, an h1-6 (heading) tag can??™t contain
a paragraph. Besides using validation, you can let common
sense be your guide to avoid these problems. You wouldn??™t put
an entire paragraph inside a paragraph heading when you are
writing on paper or in Word, so don??™t do illogical things like that
in your XHTML either, and you won??™t go far wrong.
7. Write tags entirely in lowercase. Self-explanatory??”no capital
letters at all.
Pages:
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43