HTML and CSS Reference
attribution than a physical location on a street in a town somewhere (though it can certainly include a
physical addresses as well). An address element says, “This is who is responsible for this article, and
here's how to reach them.”
The address element is flow content, requires an end tag, and can contain any other flow elements except
heading content, sectioning content, or another address . Previous versions of HTML only permitted links
and inline phrasing elements within an address , but that restriction has been lifted in HTML5.
Listing 4-13 shows some contact information wrapped in an address element, with a few line breaks
( <br> ) to provide some additional formatting.
Listing 4-13. Contact info marked up with the address element
<p><a href="/people/cindy">Cindy Li</a>, Warrior Princess
<br>1187 Hunterwasser, San Francisco, California
<br><a href=" http://cindyli.com">ci ndyli.com</a></p>
This example would be semantically appropriate in an article written by Cindy Li, or in an entire document
for which Cindy is responsible. If you simply wanted to include Cindy's contact information amidst content
she didn't write, some other element would be called for, probably an ordinary paragraph.
Browsers usually display the contents of an address element in an italicized font by default (see Figure
4-5). Of course, if you don't like the looks of it, you can always change its presentation with CSS.
Figure 4-5. Most browsers display the address element in italics
The address element doesn't have any required attributes.
There are no optional attributes for the address element.
As you learned in Chapter 2, white space in HTML is “collapsed” when a browser renders the document;
multiple spaces are reduced to a single space, and carriage returns are ignored. However, you can use
the pre element to define a block of preformatted text in which white space and line breaks should be
preserved exactly as they appear in the markup. This element is especially useful for displaying computer
code or poetry where line breaks and indention are important, such as in the haiku in Listing 4-14.