codescracker


html

HTML Horizontal Line



« Previous Tutorial Next Tutorial »


The HTML horizontal line is used to draw a horizontal line in a web page. It is used to divide an HTML page into the different horizontal sections. Horizontal lines are required when we need to display different types of content in the same HTML page in a distinct manner. The HR element is used to represent the horizontal line. It is an empty tag. Therefore, it does not contain any content in it.

HTML Horizontal Line Attributes

The table given below describes attributes of horizontal line (HR element).

Attribute Purpose
class Defines the name of class
lang Defines the language for the rule
dir Defines the direction of the rule, that is from left to right or right to left
id Defines the value of id
onClick Opens an HTML document on a mouse click
onDblClick Opens an HTML document on a double-click
onKeyDown Opens an HTML document on pressing of a key
onKeyPress Opens an HTML document on pressing and releasing of the mouse button
onKeyUp Opens an HTML document when a key is released
onMouseDown Opens an HTML document on clicking of a mouse button
onMouseMove Opens and HTML document on moving of the mouse pointer
onMouseOut Opens an HTML document when the mouse pointer moves out of the document
onMouseOver Opens an HTML document when the mouse pointer moves over the element
onMouseUp Opens an HTML document on releasing of the mouse button
style Defines an inline style of the element
title Provides an extra information about the element

HTML Creating Horizontal Line Example

Here is an example shows how to create a horizontal line in HTML.

<!DOCTYPE html>
<html>
<head>
	<title>HTML Horizontal Line Example</title>
</head>
<body>

<p>This is HTML Horizontal Line Example.
<hr />
shows how to create a horizontal line on a web page.</p>

</body>
</html>

Here is the sample output produced by the above HTML Horizontal Line example code:

HTML Horizontal Line

« Previous Tutorial Next Tutorial »



Tools
Calculator

Quick Links
Signup - Login - Give Online Test