graphics.html
html-spec/specifications/prose/html-4.01/present/graphics.html · 833 line(s) · html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Alignment, font styles, and horizontal rules in HTML documents</title>
<link rel="previous" href="styles.html">
<link rel="next" href="frames.html">
<link rel="contents" href="../cover.html#toc">
<link rel="stylesheet" type="text/css" href=
"http://www.w3.org/StyleSheets/TR/W3C-REC">
<link rel="STYLESHEET" href="../style/default.css" type="text/css">
</head>
<body>
<div class="navbar" align="center"> <a href="styles.html">previous</a>
<a href="frames.html">next</a> <a href="../cover.html#minitoc">
contents</a> <a href="../index/elements.html">elements</a> <a
href="../index/attributes.html">attributes</a> <a href=
"../index/list.html">index</a>
<hr></div>
<h1 align="center"><a name="h-15">15</a> Alignment, font styles, and horizontal
rules</h1>
<div class="subtoc">
<p><strong>Contents</strong></p>
<ol>
<li><a class="tocxref" href="#h-15.1">Formatting</a>
<ol>
<li><a class="tocxref" href="#h-15.1.1">Background color</a></li>
<li><a class="tocxref" href="#h-15.1.2">Alignment</a></li>
<li><a class="tocxref" href="#h-15.1.3">Floating objects</a>
<ul>
<li><a class="tocxref" href="#h-15.1.3.1">Float an object</a></li>
<li><a class="tocxref" href="#h-15.1.3.2">Float text around an object</a></li>
</ul>
</li>
</ol>
</li>
<li><a class="tocxref" href="#h-15.2">Fonts</a>
<ol>
<li><a class="tocxref" href="#h-15.2.1">Font style elements: the <samp class=
"einst2">TT</samp>, <samp class="einst2">I</samp>, <samp class="einst2-B">
B</samp>, <samp class="einst2">BIG</samp>, <samp class="einst2">SMALL</samp>,
<samp class="einst2">STRIKE</samp>, <samp class="einst2">S</samp>, and <samp
class="einst2">U</samp> elements</a></li>
<li><a class="tocxref" href="#h-15.2.2">Font modifier elements: <samp class=
"einst2">FONT</samp> and <samp class="einst2">BASEFONT</samp></a></li>
</ol>
</li>
<li><a class="tocxref" href="#h-15.3">Rules: the <samp class="einst2">HR</samp>
element</a></li>
</ol>
</div>
<p><em>This section of the specification discusses some HTML elements and
attributes that may be used for visual formatting of elements. Many of them are
<a href="../conform.html#deprecated">deprecated</a>.</em></p>
<h2><a name="h-15.1">15.1</a> Formatting</h2>
<h3><a name="h-15.1.1">15.1.1</a> <span class="index-inst" title="background
color|color::background"><a name="background-color">Background
color</a></span></h3>
<div class="adef-list">
<p><em>Attribute definitions</em></p>
<dl>
<dt><a name="adef-bgcolor"><samp class="adef">bgcolor</samp></a> = <a href=
"../types.html#type-color"><em>color</em></a> <a href=
"../types.html#case-insensitive">[CI]</a></dt>
<dd><a href="../conform.html#deprecated"><strong>Deprecated.</strong></a> This
attribute sets the background color for the document body or table cells.</dd>
</dl>
<p>This attribute sets the background color of the canvas for the document body
(the <a href="../struct/global.html#edef-BODY" class="noxref"><samp class=
"einst">BODY</samp></a> element) or for tables (the <a href=
"../struct/tables.html#edef-TABLE" class="noxref"><samp class="einst">
TABLE</samp></a>, <a href="../struct/tables.html#edef-TR" class="noxref"><samp
class="einst">TR</samp></a>, <a href="../struct/tables.html#edef-TH" class=
"noxref"><samp class="einst">TH</samp></a>, and <a href=
"../struct/tables.html#edef-TD" class="noxref"><samp class="einst">
TD</samp></a> elements). Additional attributes for specifying text color can be
used with the <a href="../struct/global.html#edef-BODY" class="noxref"><samp
class="einst">BODY</samp></a> element.</p>
<p>This attribute has been <a href="../conform.html#deprecated">deprecated</a>
in favor of style sheets for specifying background color information.</p>
</div>
<h3><a name="h-15.1.2">15.1.2</a> <span class="index-inst" title="alignment::of
block-level elements"><a name="alignment">Alignment</a></span></h3>
<p>It is possible to align block elements (tables, images, objects, paragraphs,
etc.) on the canvas with the <samp>align</samp> attribute. Although this
attribute may be set for many HTML elements, its range of possible values
sometimes differs from element to element. Here we only discuss the meaning of
the align attribute for text.</p>
<div class="adef-list">
<p><em>Attribute definitions</em></p>
<dl>
<dt><a name="adef-align"><samp class="adef">align</samp></a> = <samp>
left|center|right|justify</samp> <a href="../types.html#case-insensitive">
[CI]</a></dt>
<dd><a href="../conform.html#deprecated"><strong>Deprecated.</strong></a> This
attribute specifies the horizontal alignment of its element with respect to the
surrounding context. Possible values:
<ul>
<li><samp>left</samp>: text lines are rendered flush left.</li>
<li><samp>center</samp>: text lines are centered.</li>
<li><samp>right</samp>: text lines are rendered flush right.</li>
<li><samp>justify</samp>: text lines are justified to both margins.</li>
</ul>
</dd>
</dl>
<p>The default depends on the base text direction. For left to right text, the
default is <samp>align=left</samp>, while for right to left text, the default
is <samp>align=right</samp>.</p>
</div>
<div class="deprecated-example">
<p><span class="example-title">DEPRECATED EXAMPLE:</span>
<br>
This example centers a heading on the canvas.</p>
<pre>
<H1 align="center"> How to Carve Wood </H1>
</pre>
</div>
<div class="example">
<p>Using CSS, for example, you could achieve the same effect as follows:</p>
<pre>
<HEAD>
<TITLE>How to Carve Wood</TITLE>
<STYLE type="text/css">
H1 { text-align: center}
</STYLE>
<BODY>
<H1> How to Carve Wood </H1>
</pre>
<p>Note that this would center all <a href="../struct/global.html#edef-H1"
class="noxref"><samp class="einst">H1</samp></a> declarations. You could reduce
the scope of the style by setting the <a href=
"../struct/global.html#adef-class" class="noxref"><samp class="ainst">
class</samp></a> attribute on the element:</p>
<pre>
<HEAD>
<TITLE>How to Carve Wood</TITLE>
<STYLE type="text/css">
H1.wood {text-align: center}
</STYLE>
<BODY>
<H1 class="wood"> How to Carve Wood </H1>
</pre>
</div>
<div class="deprecated-example">
<p><span class="example-title">DEPRECATED EXAMPLE:</span>
<br>
Similarly, to right align a paragraph on the canvas with HTML's <a href=
"graphics.html#adef-align" class="noxref"><samp class="ainst">align</samp></a>
attribute you could have:</p>
<pre>
<P align="right"><em>...Lots of paragraph text...</em>
</pre>
</div>
<div class="example">
<p>which, with CSS, would be:</p>
<pre>
<HEAD>
<TITLE>How to Carve Wood</TITLE>
<STYLE type="text/css">
P.mypar {text-align: right}
</STYLE>
<BODY>
<P class="mypar"><em>...Lots of paragraph text...</em>
</pre>
</div>
<div class="deprecated-example">
<p><span class="example-title">DEPRECATED EXAMPLE:</span>
<br>
To right align a series of paragraphs, group them with the <a href=
"../struct/global.html#edef-DIV" class="noxref"><samp class="einst">
DIV</samp></a> element:</p>
<pre>
<DIV align="right">
<P><em>...text in first paragraph...</em>
<P><em>...text in second paragraph...</em>
<P><em>...text in third paragraph...</em>
</DIV>
</pre>
</div>
<div class="example">
<p>With CSS, the text-align property is inherited from the parent element, you
can therefore use:</p>
<pre>
<HEAD>
<TITLE>How to Carve Wood</TITLE>
<STYLE type="text/css">
DIV.mypars {text-align: right}
</STYLE>
<BODY>
<DIV class="mypars">
<P><em>...text in first paragraph...</em>
<P><em>...text in second paragraph...</em>
<P><em>...text in third paragraph...</em>
</DIV>
</pre>
<p>To center the entire document with CSS:</p>
<pre>
<HEAD>
<TITLE>How to Carve Wood</TITLE>
<STYLE type="text/css">
BODY {text-align: center}
</STYLE>
<BODY>
<em>...the body is centered...</em>
</BODY>
</pre>
</div>
<p>The <a name="edef-CENTER"><samp class="edef">CENTER</samp></a> element is
exactly equivalent to specifying the <a href="../struct/global.html#edef-DIV"
class="noxref"><samp class="einst">DIV</samp></a> element with the <a href=
"graphics.html#adef-align" class="noxref"><samp class="ainst">align</samp></a>
attribute set to "center". <strong>The <a href="graphics.html#edef-CENTER"
class="noxref"><samp class="einst">CENTER</samp></a> element is <a href=
"../conform.html#deprecated">deprecated</a>.</strong></p>
<h3><a name="h-15.1.3">15.1.3</a> <a name="floating">Floating objects</a></h3>
<p>Images and objects may appear directly "in-line" or may be floated to one
side of the page, temporarily altering the margins of text that may flow on
either side of the object.</p>
<h4><span class="index-inst" title="alignment::floats|floating objects"><a
name="idx-alignment-1">Float an object</a></span><a name=
"h-15.1.3.1"> </a></h4>
<p>The <a href="graphics.html#adef-align" class="noxref"><samp class="ainst">
align</samp></a> attribute for objects, images, tables, frames, etc., causes
the object to float to the left or right margin. Floating objects generally
begin a new line. This attribute takes the following values:</p>
<ul>
<li><samp>left:</samp> Floats the object to the current left margin. Subsequent
text flows along the image's right side.</li>
<li><samp>right:</samp> Floats the object to the current right margin.
Subsequent text flows along the image's left side.</li>
</ul>
<div class="deprecated-example">
<p><span class="example-title">DEPRECATED EXAMPLE:</span>
<br>
The following example shows how to float an <a href=
"../struct/objects.html#edef-IMG" class="noxref"><samp class="einst">
IMG</samp></a> element to the current left margin of the canvas.</p>
<pre>
<IMG align="left" src="http://foo.com/animage.gif" alt="my boat">
</pre>
</div>
<p>Some alignment attributes also permit the "center" value, which does not
cause floating, but centers the object within the current margins. However, for
<a href="../struct/text.html#edef-P" class="noxref"><samp class="einst">
P</samp></a> and <a href="../struct/global.html#edef-DIV" class="noxref"><samp
class="einst">DIV</samp></a>, the value "center" causes the contents of the
element to be centered.</p>
<h4><span class="index-inst" title="text::floating|alignment::floating
text|floating text"><a name="idx-text">Float text around an object</a></span><a
name="h-15.1.3.2"> </a></h4>
<p>Another attribute, defined for the <a href="../struct/text.html#edef-BR"
class="noxref"><samp class="einst">BR</samp></a> element, controls <span class=
"index-inst" title="line break::and floating text"><a name="idx-line_break">
text flow</a></span> around floating objects.</p>
<div class="adef-list">
<p><em>Attribute definitions</em></p>
<dl>
<dt><a name="adef-clear"><samp class="adef">clear</samp></a> = <samp>
none|left|right|all</samp> <a href="../types.html#case-insensitive">
[CI]</a></dt>
<dd><a href="../conform.html#deprecated"><strong>Deprecated.</strong></a>
Specifies where the next line should appear in a visual browser after the line
break caused by this element. This attribute takes into account floating
objects (images, tables, etc.). Possible values:
<ul>
<li><samp>none:</samp> The next line will begin normally. This is the default
value.</li>
<li><samp>left:</samp> The next line will begin at nearest line below any
floating objects on the left-hand margin.</li>
<li><samp>right:</samp> The next line will begin at nearest line below any
floating objects on the right-hand margin.</li>
<li><samp>all:</samp> The next line will begin at nearest line below any
floating objects on either margin.</li>
</ul>
</dd>
</dl>
</div>
<div class="example">
<p>Consider the following visual scenario, where text flows to the right of an
image until a line is broken by a <a href="../struct/text.html#edef-BR" class=
"noxref"><samp class="einst">BR</samp></a>:</p>
<pre>
********* -------
| | -------
| image | --<BR>
| |
*********
</pre>
<p>If the <a href="graphics.html#adef-clear" class="noxref"><samp class=
"ainst-BR">clear</samp></a> attribute is set to <samp>none</samp>, the line
following <a href="../struct/text.html#edef-BR" class="noxref"><samp class=
"einst">BR</samp></a> will begin immediately below it at the right margin of
the image:</p>
<pre>
********* -------
| | -------
| image | --<BR>
| | ------
*********
</pre>
</div>
<div class="deprecated-example">
<p><span class="example-title">DEPRECATED EXAMPLE:</span>
<br>
If the <a href="graphics.html#adef-clear" class="noxref"><samp class=
"ainst-BR">clear</samp></a> attribute is set to <samp>left</samp> or <samp>
all</samp>, the next line will appear as follows:</p>
<pre>
********* -------
| | -------
| image | --<BR clear="left">
| |
*********
-----------------
</pre>
</div>
<div class="example">
<p>Using style sheets, you could specify that all line breaks should behave
this way for objects (images, tables, etc.) floating against the left margin.
With CSS, you could achieve this as follows:</p>
<pre>
<STYLE type="text/css">
BR { clear: left }
</STYLE>
</pre>
<p>To specify this behavior for a specific instance of the <a href=
"../struct/text.html#edef-BR" class="noxref"><samp class="einst">BR</samp></a>
element, you could combine style information and the <a href=
"../struct/global.html#adef-id" class="noxref"><samp class="ainst">
id</samp></a> attribute:</p>
<pre>
<HEAD>
<em>...</em>
<STYLE type="text/css">
BR#mybr { clear: left }
</STYLE>
</HEAD>
<BODY>
<P>...
********* -------
| | -------
| table | --<BR id="mybr">
| |
*********
-----------------
...
</BODY>
</pre>
</div>
<h2><a name="h-15.2">15.2</a> <span class="index-inst" title="font::style with
HTML"><a name="graphics-fonts">Fonts</a></span></h2>
<p><em>The following HTML elements specify font information. Although they are
not all <a href="../conform.html#deprecated">deprecated</a>, their use is
discouraged in favor of style sheets.</em></p>
<h3><a name="h-15.2.1">15.2.1</a> <a name="font-style">Font style elements</a>:
the <a name="edef-TT"><samp class="edef">TT</samp></a>, <a name="edef-I"><samp
class="edef">I</samp></a>, <a name="edef-B"><samp class="edef-B">B</samp></a>,
<a name="edef-BIG"><samp class="edef">BIG</samp></a>, <a name="edef-SMALL">
<samp class="edef">SMALL</samp></a>, <a name="edef-STRIKE"><samp class="edef">
STRIKE</samp></a>, <a name="edef-S"><samp class="edef">S</samp></a>, and <a
name="edef-U"><samp class="edef">U</samp></a> elements</h3>
<div class="dtd-fragment">
<pre class="dtd-fragment">
<!ENTITY % fontstyle
"<a href="graphics.html#edef-TT" class="noxref"><samp class=
"einst">TT</samp></a> | <a href="graphics.html#edef-I" class="noxref"><samp
class="einst">I</samp></a> | <a href="graphics.html#edef-B" class=
"noxref"><samp class="einst">B</samp></a> | <a href="graphics.html#edef-BIG"
class="noxref"><samp class="einst">BIG</samp></a> | <a href=
"graphics.html#edef-SMALL" class="noxref"><samp class=
"einst">SMALL</samp></a>">
<!ELEMENT (<a href="../sgml/dtd.html#fontstyle">%fontstyle;</a>|<a href=
"../sgml/dtd.html#phrase">%phrase;</a>) - - (<a href=
"../sgml/dtd.html#inline">%inline;</a>)*>
<!ATTLIST (<a href="../sgml/dtd.html#fontstyle">%fontstyle;</a>|<a href=
"../sgml/dtd.html#phrase">%phrase;</a>)
<a href=
"../sgml/dtd.html#attrs">%attrs;</a> -- <a href=
"../sgml/dtd.html#coreattrs">%coreattrs</a>, <a href=
"../sgml/dtd.html#i18n">%i18n</a>, <a href=
"../sgml/dtd.html#events">%events</a> --
>
</pre>
</div>
<p><em>Start tag: <strong>required</strong>, End tag: <strong>
required</strong></em></p>
<div class="aref-list">
<p><em>Attributes defined elsewhere</em></p>
<ul>
<li><a href="../struct/global.html#adef-id" class="noxref"><samp class="ainst">
id</samp></a>, <a href="../struct/global.html#adef-class" class="noxref"><samp
class="ainst">class</samp></a> (<a href=
"../struct/global.html#id-and-class">document-wide identifiers</a>)</li>
<li><a href="../struct/dirlang.html#adef-lang" class="noxref"><samp class=
"ainst">lang</samp></a> (<a href=
"../struct/dirlang.html#language-info">language information</a>), <a href=
"../struct/dirlang.html#adef-dir" class="noxref"><samp class="ainst">
dir</samp></a> (<a href="../struct/dirlang.html#bidirection">text
direction</a>)</li>
<li><a href="../struct/global.html#adef-title" class="noxref"><samp class=
"ainst">title</samp></a> (<a href="../struct/global.html#title">element
title</a>)</li>
<li><a href="styles.html#adef-style" class="noxref"><samp class="ainst">
style</samp></a> (<a href="../present/styles.html#style-element">inline style
information</a>)</li>
<li><a href="../interact/scripts.html#adef-onclick" class="noxref"><samp class=
"ainst">onclick</samp></a>, <a href="../interact/scripts.html#adef-ondblclick"
class="noxref"><samp class="ainst">ondblclick</samp></a>, <a href=
"../interact/scripts.html#adef-onmousedown" class="noxref"><samp class="ainst">
onmousedown</samp></a>, <a href="../interact/scripts.html#adef-onmouseup"
class="noxref"><samp class="ainst">onmouseup</samp></a>, <a href=
"../interact/scripts.html#adef-onmouseover" class="noxref"><samp class="ainst">
onmouseover</samp></a>, <a href="../interact/scripts.html#adef-onmousemove"
class="noxref"><samp class="ainst">onmousemove</samp></a>, <a href=
"../interact/scripts.html#adef-onmouseout" class="noxref"><samp class="ainst">
onmouseout</samp></a>, <a href="../interact/scripts.html#adef-onkeypress"
class="noxref"><samp class="ainst">onkeypress</samp></a>, <a href=
"../interact/scripts.html#adef-onkeydown" class="noxref"><samp class="ainst">
onkeydown</samp></a> <a href="../interact/scripts.html#adef-onkeyup" class=
"noxref"><samp class="ainst">onkeyup</samp></a> (<a href=
"../interact/scripts.html#events">intrinsic events</a>)</li>
</ul>
</div>
<p>Rendering of font style elements depends on the user agent. The following is
an informative description only.</p>
<dl>
<dd><b>TT:</b> Renders as teletype or monospaced text.</dd>
<dd><b>I:</b> Renders as italic text style.</dd>
<dd><b>B:</b> Renders as bold text style.</dd>
<dd><b>BIG:</b> Renders text in a "large" font.</dd>
<dd><b>SMALL:</b> Renders text in a "small" font.</dd>
<dd><b>STRIKE</b> and <b>S:</b> <a href="../conform.html#deprecated"><strong>
Deprecated.</strong></a> Render strike-through style text.</dd>
<dd><b>U:</b> <a href="../conform.html#deprecated"><strong>
Deprecated.</strong></a> Renders underlined text.</dd>
</dl>
<div class="example">
<p>The following sentence shows several types of text:</p>
<pre>
<P><b>bold</b>,
<i>italic</i>, <b><i>bold italic</i></b>, <tt>teletype text</tt>, and
<big>big</big> and <small>small</small> text.
</pre>
<p>These words might be rendered as follows:</p>
<p><img src="../images/fontstyle.gif" alt=
"An example of rendering of various font styles"></p>
<p>It is possible to achieve a much richer variety of font effects using style
sheets. To specify blue, italic text in a paragraph with CSS:</p>
<pre>
<HEAD>
<STYLE type="text/css">
P#mypar {font-style: italic; color: blue}
</STYLE>
</HEAD>
<P id="mypar"><em>...Lots of blue italic text...</em>
</pre>
</div>
<p>Font style elements must be properly nested. Rendering of nested font style
elements depends on the user agent.</p>
<h3><a name="h-15.2.2">15.2.2</a> <a name="font-modifier">Font modifier
elements:</a> <a name="edef-FONT"><samp class="edef">FONT</samp></a> and <a
name="edef-BASEFONT"><samp class="edef">BASEFONT</samp></a></h3>
<p><strong><a href="graphics.html#edef-FONT" class="noxref"><samp class=
"einst">FONT</samp></a> and <a href="graphics.html#edef-BASEFONT" class=
"noxref"><samp class="einst">BASEFONT</samp></a> are <a href=
"../conform.html#deprecated">deprecated</a>.</strong></p>
<p>See the <a href="../sgml/loosedtd.html#basefont">Transitional DTD</a> for
the formal definition.</p>
<div class="adef-list">
<p><em>Attribute definitions</em></p>
<dl>
<dt><a name="adef-size-FONT"><samp class="adef">size</samp></a><a name=
"adef-size-BASEFONT"> </a> = <a href="../types.html#type-cdata"><em>
cdata</em></a> <a href="../types.html#case-neutral">[CN]</a></dt>
<dd><a href="../conform.html#deprecated"><strong>Deprecated.</strong></a> This
attribute sets the size of the font. Possible values:
<ul>
<li>An integer between 1 and 7. This sets the font to some fixed size, whose
rendering depends on the user agent. Not all user agents may render all seven
sizes.</li>
<li>A relative increase in font size. The value "+1" means one size larger. The
value "-3" means three sizes smaller. All sizes belong to the scale of 1 to
7.</li>
</ul>
</dd>
<dt><a name="adef-color-FONT"><samp class="adef">color</samp></a> = <a href=
"../types.html#type-color"><em>color</em></a> <a href=
"../types.html#case-insensitive">[CI]</a></dt>
<dd><a href="../conform.html#deprecated"><strong>Deprecated.</strong></a> This
attribute sets the text color.</dd>
<dt><a name="adef-face-FONT"><samp class="adef">face</samp></a> = <a href=
"../types.html#type-cdata"><em>cdata</em></a> <a href=
"../types.html#case-insensitive">[CI]</a></dt>
<dd><a href="../conform.html#deprecated"><strong>Deprecated.</strong></a> This
attribute defines a comma-separated list of font names the user agent should
search for in order of preference.</dd>
</dl>
</div>
<div class="aref-list">
<p><em>Attributes defined elsewhere</em></p>
<ul>
<li><a href="../struct/global.html#adef-id" class="noxref"><samp class="ainst">
id</samp></a>, <a href="../struct/global.html#adef-class" class="noxref"><samp
class="ainst">class</samp></a> (<a href=
"../struct/global.html#id-and-class">document-wide identifiers</a>)</li>
<li><a href="../struct/dirlang.html#adef-lang" class="noxref"><samp class=
"ainst">lang</samp></a> (<a href=
"../struct/dirlang.html#language-info">language information</a>), <a href=
"../struct/dirlang.html#adef-dir" class="noxref"><samp class="ainst">
dir</samp></a> (<a href="../struct/dirlang.html#bidirection">text
direction</a>)</li>
<li><a href="../struct/global.html#adef-title" class="noxref"><samp class=
"ainst">title</samp></a> (<a href="../struct/global.html#title">element
title</a>)</li>
<li><a href="styles.html#adef-style" class="noxref"><samp class="ainst">
style</samp></a> (<a href="../present/styles.html#style-element">inline style
information</a>)</li>
</ul>
</div>
<p>The <a href="graphics.html#edef-FONT" class="noxref"><samp class="einst">
FONT</samp></a> element changes the font size and color for text in its
contents.</p>
<p>The <a href="graphics.html#edef-BASEFONT" class="noxref"><samp class=
"einst">BASEFONT</samp></a> element sets the base font size (using the <samp
class="ainst">size</samp> attribute). Font size changes achieved with <a href=
"graphics.html#edef-FONT" class="noxref"><samp class="einst">FONT</samp></a>
are relative to the base font size set by <a href="graphics.html#edef-BASEFONT"
class="noxref"><samp class="einst">BASEFONT</samp></a>. If <a href=
"graphics.html#edef-BASEFONT" class="noxref"><samp class="einst">
BASEFONT</samp></a> is not used, the default base font size is 3.</p>
<div class="deprecated-example">
<p><span class="example-title">DEPRECATED EXAMPLE:</span>
<br>
The following example will show the difference between the seven font sizes
available with <a href="graphics.html#edef-FONT" class="noxref"><samp class=
"einst">FONT</samp></a>:</p>
<pre>
<P><font size=1>size=1</font>
<font size=2>size=2</font>
<font size=3>size=3</font>
<font size=4>size=4</font>
<font size=5>size=5</font>
<font size=6>size=6</font>
<font size=7>size=7</font>
</pre>
<p>This might be rendered as:</p>
<p><img src="../images/font1.gif" alt=
"Example of rendering of various font sizes"></p>
<p>The following shows an example of the effect of relative font sizes using a
base font size of 3:</p>
<p><img src="../images/font2.gif" alt=
"Example of rendering of various font sizes with a basefont"></p>
</div>
<p>The base font size does not apply to headings, except where these are
modified using the <a href="graphics.html#edef-FONT" class="noxref"><samp
class="einst">FONT</samp></a> element with a relative font size change.</p>
<h2><a name="h-15.3">15.3</a> <span class="index-inst" title="rule::between
block-level elements">Rules: the <a name="edef-HR"><samp class="edef">
HR</samp></a> element</span></h2>
<div class="dtd-fragment">
<pre class="dtd-fragment">
<!ELEMENT <a href="graphics.html#edef-HR" class="noxref"><samp class=
"einst">HR</samp></a> - O EMPTY -- horizontal rule -->
<!ATTLIST HR
<a href=
"../sgml/dtd.html#attrs">%attrs;</a> -- <a href=
"../sgml/dtd.html#coreattrs">%coreattrs</a>, <a href=
"../sgml/dtd.html#i18n">%i18n</a>, <a href=
"../sgml/dtd.html#events">%events</a> --
>
</pre>
</div>
<p><em>Start tag: <strong>required</strong>, End tag: <strong>
forbidden</strong></em></p>
<div class="adef-list">
<p><em>Attribute definitions</em></p>
<dl>
<dt><a name="adef-align-HR"><samp class="adef">align</samp></a> = <samp>
left|center|right</samp> <a href="../types.html#case-insensitive">[CI]</a></dt>
<dd><a href="../conform.html#deprecated"><strong>Deprecated.</strong></a> This
attribute specifies the horizontal alignment of the rule with respect to the
surrounding context. Possible values:
<ul>
<li><samp>left</samp>: the rule is rendered flush left.</li>
<li><samp>center</samp>: the rule is centered.</li>
<li><samp>right</samp>: the rule is rendered flush right.</li>
</ul>
<p>The default is <samp>align=center</samp>.</p>
</dd>
<dt><a name="adef-noshade"><samp class="adef">noshade</samp></a> <a href=
"../types.html#case-insensitive">[CI]</a></dt>
<dd><a href="../conform.html#deprecated"><strong>Deprecated.</strong></a> When
set, this boolean attribute requests that the user agent render the rule in a
solid color rather than as the traditional two-color "groove".</dd>
<dt><a name="adef-size-HR"><samp class="adef">size</samp></a> = <a href=
"../types.html#type-pixels"><em>pixels</em></a> <a href=
"../types.html#case-insensitive">[CI]</a></dt>
<dd><a href="../conform.html#deprecated"><strong>Deprecated.</strong></a> This
attribute specifies the height of the rule. The default value for this
attribute depends on the user agent.</dd>
<dt><a name="adef-width-HR"><samp class="adef">width</samp></a> = <a href=
"../types.html#type-length"><em>length</em></a> <a href=
"../types.html#case-insensitive">[CI]</a></dt>
<dd><a href="../conform.html#deprecated"><strong>Deprecated.</strong></a> This
attribute specifies the width of the rule. The default width is 100%, i.e., the
rule extends across the entire canvas.</dd>
</dl>
</div>
<div class="aref-list">
<p><em>Attributes defined elsewhere</em></p>
<ul>
<li><a href="../struct/global.html#adef-id" class="noxref"><samp class="ainst">
id</samp></a>, <a href="../struct/global.html#adef-class" class="noxref"><samp
class="ainst">class</samp></a> (<a href=
"../struct/global.html#id-and-class">document-wide identifiers</a>)</li>
<li><a href="../struct/dirlang.html#adef-lang" class="noxref"><samp class=
"ainst">lang</samp></a> (<a href=
"../struct/dirlang.html#language-info">language information</a>), <a href=
"../struct/dirlang.html#adef-dir" class="noxref"><samp class="ainst">
dir</samp></a> (<a href="../struct/dirlang.html#bidirection">text
direction</a>)</li>
<li><a href="../struct/global.html#adef-title" class="noxref"><samp class=
"ainst">title</samp></a> (<a href="../struct/global.html#title">element
title</a>)</li>
<li><a href="styles.html#adef-style" class="noxref"><samp class="ainst">
style</samp></a> (<a href="../present/styles.html#style-element">inline style
information</a>)</li>
<li><a href="../interact/scripts.html#adef-onclick" class="noxref"><samp class=
"ainst">onclick</samp></a>, <a href="../interact/scripts.html#adef-ondblclick"
class="noxref"><samp class="ainst">ondblclick</samp></a>, <a href=
"../interact/scripts.html#adef-onmousedown" class="noxref"><samp class="ainst">
onmousedown</samp></a>, <a href="../interact/scripts.html#adef-onmouseup"
class="noxref"><samp class="ainst">onmouseup</samp></a>, <a href=
"../interact/scripts.html#adef-onmouseover" class="noxref"><samp class="ainst">
onmouseover</samp></a>, <a href="../interact/scripts.html#adef-onmousemove"
class="noxref"><samp class="ainst">onmousemove</samp></a>, <a href=
"../interact/scripts.html#adef-onmouseout" class="noxref"><samp class="ainst">
onmouseout</samp></a>, <a href="../interact/scripts.html#adef-onkeypress"
class="noxref"><samp class="ainst">onkeypress</samp></a>, <a href=
"../interact/scripts.html#adef-onkeydown" class="noxref"><samp class="ainst">
onkeydown</samp></a>, <a href="../interact/scripts.html#adef-onkeyup" class=
"noxref"><samp class="ainst">onkeyup</samp></a> (<a href=
"../interact/scripts.html#events">intrinsic events</a>)</li>
</ul>
</div>
<p>The <a href="graphics.html#edef-HR" class="noxref"><samp class="einst">
HR</samp></a> element causes a horizontal rule to be rendered by visual user
agents.</p>
<p>The amount of vertical space inserted between a rule and the content that
surrounds it depends on the user agent.</p>
<div class="deprecated-example">
<p><span class="example-title">DEPRECATED EXAMPLE:</span>
<br>
This example centers the rules, sizing them to half the available width
between the margins. The top rule has the default thickness while the bottom
two are set to 5 pixels. The bottom rule should be rendered in a solid color
without shading:</p>
<pre>
<HR width="50%" align="center">
<HR size="5" width="50%" align="center">
<HR noshade size="5" width="50%" align="center">
</pre>
<p>These rules might be rendered as follows:</p>
<p align="center"><img src="../images/hr.gif" alt=
"Example of rendering of various horizontal rules"></p>
</div>
<div class="navbar" align="center">
<hr><a href="styles.html">previous</a> <a href="frames.html">next</a>
<a href="../cover.html#minitoc">contents</a> <a href=
"../index/elements.html">elements</a> <a href=
"../index/attributes.html">attributes</a> <a href="../index/list.html">
index</a></div>
</body>
</html>