Journal

Style with CSS turned off using the “hr” tag

Posted by Hyun on February 15th, 2007

Did you know that the "hr" tag is quite a useful tag? Let's say the user views your web site with the CSS styling off or they are viewing through a mobile device, by adding the code "hr" tag will help better visually organize your contents on your web page by having line dividers between each sections. However, you need to hide the the tag with CSS so that the line is hidden when the CSS is on and the line shows up when the CSS is off. See example below.


image
The left side of the screenshot above contains the CSS styling and the right side screenshot has the styling off. When the CSS is off, note the horizontal lines between the dividing the sections to give more distinctions between the sections. You can quickly see that the lines divide the header, navigation, search, content area ... etc. Your visitors who likes to view your web page with the CSS style off, will appreciate it. A little consideration goes a long way.

Here are the codes:
XHTML code:

<div id="header">
<
p>Header Content</p>
</
div>
<
hr />
<
div id="nav">
<
p>Navigation Content</p>
</
div>
<
hr />

CSS code:
hr {
 display
none;
 
}

I hope this tip is useful for you.


Categories: CSS tutorial

Next entry: My new music project

Previous entry: "Um... is this mike on?"



Comments

Name:


Email (Your Email Address will not be displayed):


URL:


Comment:

Remember my personal information

Notify me of follow-up comments?








Home | About | News | Work | Journal | Contact | Client login

©1996 - 2008 Progressive Design In Motion
Hosted by Servint | A robust CMS powered by Expression Engine.