HTML and CSS Reference
In-Depth Information
and portable holes.
In this case, just wrap the excess text in a paragraph or a div as appropriate:
<h1>Welcome to Acme!</h2>
Your one-stop source for rockets, explosives, anvils,
and portable holes.
Another element that often surprises is img . This is an inline element, and it should be wrapped in a div or
possibly a paragraph. For instance, change this:
<img src="cup.gif" width="89" height="67" alt="Cup" />
to this:
<img src="cup.gif" width="89" height="67" alt="Cup"/>
figure Element
HTML 5 may add a figure element specifically for block-level images:
<img src="cup.gif" alt="Cup"
width="89" height="67"/>
It is also a validity error if a p element contains another p or block element. The paragraph is the lowest block-
level element. Although a div , blockquote , or table can contain a paragraph, the reverse is not true. For
example, this is a problem:
<p>Once upon a time someone famous said,
<blockquote cite="Percy Bysshe Shelley, Ozymandias">
<p>My name is Ozymandias, king of kings</p>
<p>Look on my works, ye mighty, and despair!</p>
but who it was that said that, I cannot say. He has been
The usual way to fix it is to make two paragraphs—one before the blockquote and one after, like so:
<p>Once upon a time someone famous said,</p>
Search WWH ::

Custom Search