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:
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:
Edit the text indicated in bold
to suit your needs.
More Web Design
Tips |