Horizontal rules can increase webpage readability by providing a separation between different topics on a page. Horizontal rules are often used to separate a footer or resource box at the bottom of a webpage from the main webpage content. HTML by itself creates some pretty bland horizontal rules. But with CSS designers have the means to create interesting horizontal rules.
Welcome to Bucaro TecHelp!

Welcome to Bucaro TecHelp!
Maintain Your Computer and Use it More Effectively
to Design a Web Site and Make Money on the Web

[About BTH]  [User Agreement]  [Privacy Policy]  [Site Map]  [Contact Form]  [Advertise on BTH]  [News Feed]

Google
Web
This Site

Create Custom Horizontal Rules

Horizontal rules can increase webpage readability by providing a separation between different topics on a page. Horizontal rules are often used to separate a footer or resource box at the bottom of a webpage from the main webpage content. HTML by itself creates some pretty bland horizontal rules, that's why many designers have used graphic images as horizontal rules instead. But with CSS (Cascading Style Sheets) designers now have the means to create interesting horizontal rules.

Here's your standard HTML horizontal rule:

<hr />

The horizontal rule, <hr /> tag, is still valid in HTML 4.0, but all of its attributes, like align, noshade, size, and width have been deprecated. Deprecated means don't count on them to work in future versions of HTML. That's why it's important to learn how to set the appearance of your horizontal rules with CSS. Two basic things you can set are the Height and width as shown below.

<hr style="height:6px;" />

<hr style="width:75%;" />

In the example above, I set the width to 75 percent of the width of the horizontal rule's conatining element (usually the webpage). The above examples use inline style code. The example below uses an embedded style code block to create a dotted line horizontal rule.

<style type="text/css">
#dothr
{
border-style:none; 
border-top: 2px dotted black;
border-bottom: 2px solid white;
height: 4px;
}
</style>

<hr id="dothr" />

The example below uses an embedded style code block to create a dashed line horizontal rule.

<style type="text/css">
#dashr
{
border-style:none;
border-top: 1px dashed black;
border-bottom: 1px dashed gray;
height: 2px;
}
</style>

<hr id="dashr" />

Web Design Sections

RSS Feed RSS Feed

Cascading Style Sheets
Understanding CSS Selectors
The CSS Box Model
Understanding CSS Positioning
Add Style to Your Blockquotes
How to Overlay Text on an Image
Display Overlapping Images on Your Webpage
Style Your Imagemap Tooltips
How to Style a List
How to Style a Table
How to Change the Mouse Pointer
How to Use a Starburst on Your Web Page
How to Use a Pull Quote
Easy Scrollable Area Code
Easy CSS Buttons
Create CSS Button Rollovers
Create Custom Horizontal Rules
Easy CSS Popup Windows
Add Drop Shadows to Your Pictures
Easy Text Drop Shadows
Spice Up Your Web Forms with Color and Graphics
Setting a Larger First Letter
Make a Fixed-width Variable-height Round Cornered Box
Easy Visual Effects to Spice Up Your Webpage
HTML, XHTML, and CSS Bible
Web Designer's Reference
Pro CSS Techniques
Code for Horizontal Drop-down Menu Bar
Easy Rollover Menu Code
Easy CSS Tabbed Navigation
Easier Expanding Menu Code
Easy Three-level Expanding Menu Code
Easy Floating Menu Code


[Site User Agreement]  [Advertise on This site]  [Search This Site]  [Contact Form]
Copyright©2001-2009 Bucaro TecHelp P.O.Box 18952 Fountain Hills, AZ 85269