You are here: Reference > HTML > tags > hr

hr element

Browser support:
Draws a horizontal rule.
Use style properties to customize the visualization of the horizontal line.
If you want to see the HTML tags by categories, please visit this page.
This element cannot have a closing tag.
JavaScript page for this element: hr.

Possible members:

Attributes
Events
Styles
Pseudos
accessKey
Sets an access key to an element.
align
Sets the horizontal alignment of an object relative to its parent.
class
Sets the style class or classes that belong to the element.
color
Sets the color of the text or line.
contentEditable
3
Sets whether the contents of the object are editable.
dir
Sets the text direction as related to the lang attribute.
draggable
3.55
Sets whether an element is draggable.
HIDEFOCUS
Specifies whether a dotted rectangle (focus rectangle) is drawn around an object while it has focus.
id
Sets a unique identifier for the object.
lang
Specifies the language of the element.
language
Sets the scripting language for the current element. Use it only for the script element.
name
Sets the name of an element.
NOSHADE
Specifies whether the horizontal rule should be displayed as flat instead of three dimensional.
size
Sets the height of the horizontal rule.
style
Sets an inline style associated with an element.
tabIndex
Specifies the tabbing order for keyboard navigation using the TAB key.
title
Specifies a tooltip for an element.
unSelectable
Sets whether the selection process can start in an element's content.
width
Specifies the default width of the element.
xml:lang
Sets the language code of the XML document.

Example HTML code 1:

This example illustrates the use of the hr element:
<hr noshade="noshade" size="5" style="width:50%; text-align:center;" />
Did you find this example helpful? yes no

Example HTML code 2:

Recommendation:
<head>
    <style>
        .rule {
            color:#CCCCCC;
            height:4px;
            border-bottom:1px solid #666666;
        }
    </style>
</head>
<body>
    <hr class="rule" />
</body>
Did you find this example helpful? yes no

External links:

User Contributed Comments

Post Content

Post Content