HTML and CSS Reference
In-Depth Information
A bit of ASCII art
that illustrates
how preformatted
text works.
Horizontal Rules
The <hr> tag, which has no closing tag in HTML and no text associated with it, creates a
horizontal line on the page. Rule lines are used to visually separate sections of a web
page—just before headings, for example, or to separate body text from a list of items.
Closing Empty Elements
The <hr> tag has no closing tag in HTML. To convert this tag to XHTML and to
ensure compatibility with HTML browsers, add a space and a forward slash to the
end of the tag:
<hr />
If the horizontal line has attributes associated with it, the forward slash still appears
at the end of the tag, as shown in the following examples:
<hr size=”2” />
<hr width=”75%” />
<hr align=”center” size=”4” width=”200” />
The following input shows a rule line and a list as you would write it in XHTML 1.0:
<hr />
<h2>To Do on Friday</h2>
<li>Do laundry</li>
<li>Send FedEx with pictures</li>
<li>Have lunch with Mollie</li>
<li>Read Email</li>
<li>Set up Ethernet</li>
<hr />
Search WWH ::

Custom Search