HTML and CSS Reference
In-Depth Information
Figure 4-3 shows what these paragraphs will look like in a browser. The p element is styled as block-level
by default, so each paragraph begins on a new line and is followed by a blank line of white space. In the
past, many web designers would inject empty paragraphs ( <p></p> ) into their documents to add more
vertical space on the page. This is the sort of presentational markup you should avoid—an empty
paragraph is meaningless. If you need to add vertical white space to your page layout, use CSS.
Figure 4-3. A browser displays the two paragraphs as separate blocks
Required Attributes
The p element doesn't have any required attributes.
Optional Attributes
Apart from the standard global attributes, there are no optional attributes for the p element.
The blockquote element designates a long quotation, such as a passage from a book or a blurb from a
review. This is a flow element that always requires an end tag. Any other flow elements can reside in a
blockquote (paragraphs, headings, lists, even other blockquotes ), but all of its contents should come
from the quoted source.
If you're quoting an online source, even if the quotation is from elsewhere on your own website, you can
include the URL of the original source in the optional cite attribute. This attribute's value must be a URL,
not a name or title. To mention a source by name, you can use the cite element covered later in this
chapter. Listing 4-12 shows a block quotation, including a source URL in the cite attribute.
Listing 4-12. A block quotation
<h1>Customer Testimonials</h1>
<p>We love our customers, and our customers love us! Here's just a
small sampling of praise from some of our satisfied champions.</p>
<blockquote cite="">
<p>Having foiled a jewelry store heist on my way to receive a
medal from the President, imagine my embarrassment to notice
a nasty laser burn on my cape. There was no time to fly back to
base and change into my spare costume, even at my speed. Thank
goodness for Power Outfitters! They had my size and style in stock,
in just the right shade of red, and at a great price, too. I went
Search WWH ::

Custom Search