HTML dividers separate Web pages into visible sections. The horizontal rule, or HR, tag is used to create simple or decorative horizontal lines on the Web. You can combine cascading style sheets (CSS) with HTML to customise a divider's colour, dimensions, alignment and three-dimensional effect. Although you can use dividers as frequently as you like and place them anywhere on your Web page.
- Skill level:
Other People Are Reading
Open the HTML file you want to modify in a text editor, such as Notepad, EditPad or TextEdit.
Add the "<hr />" code below the BODY tag where you want the divider to appear as follows. It creates a divider that spans the entire line:
Add 'style="width"' to the code to allow the divider to span a specific width. The following code sets the divider to 50 per cent of the line:
<hr style="width:50%" />
Add "height" to the code to give the line a specific thickness. The following code gives the divider a height of 3 pixels:
<hr style="width:50%;height:3px" />
Include "color" in the code to give the divider a specific colour, such as red:
<hr style="width:50%;height:3px;colour:red" />
Insert a "background-colour," "color," "height" and "width" to create a divider to apply no shade (remove its three-dimensional effect) as follows:
<hr style="height:2px;border-width:0;colour:grey;background-colour:grey" />
- 20 of the funniest online reviews ever
- 14 Biggest lies people tell in online dating sites
- Hilarious things Google thinks you're trying to search for