Explore a little.C ProgrammingC++HTMLVisual BasicSystem AnalysisE-CommerceBCA Notes
LEARN SOMETHING NEW

Horizontal line in HTML

Read4BCA learning libraryFree access

Horizontal line in HTML

The <hr>tag is used for creating a Horizontal line. This is also called Horizontal rule in HTML.
We can change the line color, using color attribute.
We can change the default line size using size attribute.
We can change the default width using width attribute.

Example:

<!DOCTYPE html>
<html>
<head>
<title>Horizontal line in HTML</title>
</head>

<body>
Simple Line
<hr>
Line with changed color.
<hr color="blue">
Line with changed size.
<hr size="10px">
Line with changed width.
<hr width="50%">
Line with changed width, color, size.
<hr width="80%" color="green" size="10px">
</body>
</html>

Output of this code will look like this:

Horizontal line in HTML example

This lesson preserves the original Read4BCA material. Some programming examples use older tools and syntax. View original page.