Your Guide to Professional
Web Site Design and Development

HTML Tips
HTML Codes
Web Development
Web Design Tips
JavaScript Codes
216 Web Safe Colors
CSS Tutorial
JavaScript Tutorial
ASCII Character Codes

Offering a guide to professional web site design, web page design and web design guidelines

| Web Site Development | HTML Codes | HTML Tips | Web Design TipsJavascript Snippets | 216 Safe Colors | Symbols | CSS Tutorial | JavaScript Tutorial |

HTML Horizontal Rule: Specifying the Width


The HORIZONTAL RULE tag is used to divide subjects within a web page.

You can specify the width of an HTML horizontal rule <HR> by adding the WIDTH attribute to your horizontal rule HTML tag.

The width value may be specified as a percentage or in pixels.

In the following example, the horizontal rule is displayed with the width set to 50%:




This example will display your horizontal rule across 50% of your page width, or if placed within a table cell, 50% of the table cell.

Copy and paste the following code into the HTML portion of your web page where you would like the horizontal rule to appear:

<HR WIDTH="50%">

Edit the text indicated in bold to suit your needs.

In the next example, the horizontal rule is displayed with the width set to 200 pixels:



Copy and paste the following code into the HTML portion of your web page where you would like the horizontal rule to appear:

<HR WIDTH="200">

Edit the text indicated in bold to suit your needs.

 More Web Design Tips