Horizontal Line in HTML

So this is pretty simply, but I feel pretty useful.

To make a horizontal line, use the


tag.  With no styling, it will give a result like this:

You can style it just like any other element, using CSS.

 <hr  style="height:3px;background-color: black;width:90%;" class="line1">


Some credit here, although some of the stuff in that post is deprecated. I believe in HTML5, the best practices are to just use standard CSS to style lines.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s