HTML and CSS Reference
In-Depth Information
When a Web browser reads a document that has HTML markup in it, it determines how
to render it onscreen by considering the HTML elements embedded within the document:
So, an HTML document is simply a text file that contains the information you want to
publish and the appropriate markup instructions indicating how the browser should
structure or present the document.
Markup elements are made up of a start tag, such as <strong> , and typically, though not
always, an end tag, which is indicated by a slash within the tag, such as </strong> . The tag
pair should fully enclose any content to be affected by the element, including text and other
HTML markup.
N OTE There is a distinction between an element (for example, strong ) and the tags ( <strong>
and </strong> ) that are used by the element. However, you will likely often find the word
“tag” used in place of “element” in many if not most discussions about HTML markup. This
observation even includes historically relevant documents discussing HTML 1 written by Tim
Berners-Lee, the founding father of the Web. Fortunately, despite any imprecision of word choice
that people may exhibit when discussing markup, meaning is usually well understood and this
should not be a tremendous concern.
Under traditional HTML (not XHTML), the close tag for some elements is optional
because their closure can be inferred. For example, a <p> tag cannot enclose another <p>
tag, and thus the closing </p> tag can be inferred when markup like this is encountered:
<p> This is a paragraph.
<p> This is also a paragraph.
Such shortened notations that depend on inference may be technically correct under the
specification, but stylistically they are not encouraged. It is always preferable to be precise,
so use markup like this instead:
<p> This is a paragraph. </p>
<p> This is also a paragraph. </p>
1 Historic intro to HTML that clearly uses the term tag instead of element
Search WWH ::

Custom Search