HTML: Horizontal line

This entry is part 16 of 34 in the series HTML

Horizontal line is useful as a divider between sections of a webpage.

To add a horizontal line, simply add the following one-sided tag where you want the line to appear.


By default, the line runs the entire width of the browser windows, is two pixels in height, and is black with a chiseled effect.

You can change these characteristics by applying attributes within the tag.

<!DOCTYPE html>
<head lang='en'>
    <meta charset='UTF-8'>
    <title>Horizontal Line</title>

<h3>British Pop</h3>
<h3>American Rock</h3>

Horizontal Line

Series Navigation<< HTML: Special characters or entities
HTML: Horizontal line styling >>