HTML <hr /> tag (presentational)S2C Home   « HTML <hr /> tag

Definition

The <hr /> tag is used for defining a horizontal rule.

Results can be better achieved using the CSS border property.

Example


<p>A line will appear in between our paragraphs.</p>
<hr />
<p>A line will appear in between our paragraphs.</p>

Required Attributes

NONE

Optional Attributes

align - Deprecated.

noshade - Deprecated.

size - Deprecated.

width - Deprecated.

Common Attributes

class - specifies a classname for the element allowing you to apply the style of the predefined class to the content.


<hr class="classname" />

id - specifies a unique id for the element allowing you to apply the style of the predefined id to the content.


<hr id="idname" />

style - specifies an inline style for the element allowing you to apply the style to the content.


<hr style="color:red;text-align:left" /> 

title - specifies extra information about the content.


<hr title="information about the content" /> 

Language Attributes

dir - specifies the directional flow of the content.


<!-- The text will flow from left to right -->
<hr dir="ltr">

<!-- The text will flow from right to left -->
<hr dir="rtl">

lang - specifies a language code for the content of the element.


<hr lang="en" />

xml:lang - specifies a language code for the content of the element in XHTML documents.


<hr xml:lang="fr" />

Document Event Attributes

NONE

Form Event Attributes

NONE

Image Event Attributes

NONE

Keyboard Event Attributes

onkeydown - The JavaScript code to be run when an element is in focus and keyboard key is pressed down and released.


<!-- Executes the go() function -->
<hr onkeydown="go()" />

onkeypress - The JavaScript code to be run when an element is in focus and keyboard key is pressed down and released.


<!-- Executes the go() function -->
<hr onkeydown="go()" />

onkeyup - The JavaScript code to be run when an element is in focus and keyboard key is released.


<!-- Executes the go() function -->
<hr onkeydown="go()" />

Mouse Event Attributes

onclick - The JavaScript code to be run when a mouse is clicked on the element.


<!-- Executes the go() function -->
<hr onclick="go()" />

ondblclick - The JavaScript code to be run when a mouse is double clicked on the element.


<!-- Executes the go() function -->
<hr ondblclick="go()" />

onmousedown - The JavaScript code to be run when the mouse button is pressed down while the cursor is over the element.


<!-- Executes the go() function -->
<hr onmousedown="go()" />

onmousemove - The JavaScript code to be run when the mouse button is moved.


<hr onmousemove="go()" />

onmouseout - The JavaScript code to be run when the mouse cursor moves off an element.


<!-- Executes the go() function -->
<hr onmouseout="go()" />

onmouseover - The JavaScript code to be run when the mouse cursor moves over an element.


<!-- Executes the go() function -->
<hr onmouseover="go()" />

onmouseup - The JavaScript code to be run when the mouse button is released while the cursor is over the element.


<!-- Executes the go() function -->
<hr onmouseup="go()" />

go to home page Homepage go to top of page Top