HTML and CSS Reference
In-Depth Information
wordsuch as the italicized "simp" syllable in our barebones exampleto
the <html> tag that bounds the entire document. The starting component
of any tag is the tag name and its attributes, if any. The corresponding
ending tag is the tag name alone, preceded by a slash ( / ). Ending tags
have no attributes.
3.3.4. Proper and Improper Nesting
You can put tags inside the affected segment of another tag (nested) for
multiple tag effects on a single segment of the document. For example,
a portion of the following text is both bold and included as part of an
anchor defined by the <a> tag:
<body>
This is some text in the body, with a
<a href="another_doc.html">link, a portion of which
is <b>set in bold.</b></a>
</body>
According to the HTML and XHTML standards, you must end nested tags
by starting with the most recent one and working your way back outfirst
in, last out. For instance, in this example, we end the bold tag ( </b> ) be-
fore ending the link tag ( </a> ) because we started in the reverse order:
<a> tag first, then <b> tag. It's a good idea to follow that standard, even
though most browsers don't absolutely insist you do so. You may get
away with violating this nesting rule for one browser, and sometimes
even with all current browsers. But eventually a new browser version
won't allow the violation, and you'll be hard-pressed to straighten out
your source HTML document. Also, be aware that the XHTML standard
explicitly forbids improper nesting.
3.3.5. Tags Without Ends
According to the HTML standard, a few tags do not have ending tags.
In fact, the standard forbids use of an end tag for these special ones,
 
Search WWH ::




Custom Search