Learn HTML : Horizontal Rules

Ever wanted to draw a line acoss your webpage ? There are a few ways to do this using images etc ,but HTML also offers a tag to do it. This article shows us how to use the horizontal rule tag in our pages.

The horizontal rule creates a separating line. It is used to separate various chunks of text. The tag is noted as


like the break tag this tag does is only made up of one tag not two. This is an example of the basic tag,


 This tag can be edited so it can be wider, thinner, thicker, a certain color, etc.

We can specify the “Line Width”



We can specify the “Line Color”



 

We can specify the “Line Height”


(default size=2)


We can specify the “Alignment”

align=”left”


align=”center”


align=”right”


So we have seen how we can draw horizontal lines, so the next question is , how do we draw verticle lines. Well , the answer is you cannot , well , not easily, html does not offer any tag to draw a verticle line. So if we want one, we could create an image of a line and add that to the page in the correct possition, but a more common way is to use tables. Lets say we want a verticle line in the center of my page to give the effect of two columns. To do this we create a html table of three columns with the middle colum having a background color. For example,

Column A   Column B

In this example we have left the border on the table , just so that you can see what we mean, but you would normaly take this off. At this stage you may not know the tags to use to make html tables, but we will be showing you how in another article.

Leave a Comment