Improve Site Performance Increase Site Traffic Monitor Site Uptime Webmaster Resources NetMechanic Home Looking For Help? Partner Programs Privacy Policy Contact Us Press Room
NetMechanic Home LOGIN | HELP | ABOUT US | PRODUCTS | SITE MAP
NetMechanic Menu
Over 52 Million Web Pages Tested!     
 
Positioning tips.
search engine optimization story search.
Search for:


Your Email:

I would like to receive my newsletter in:
HTML format
Text format


Increase traffic.
Volume 8 (2005)
   September
   June
   April
   March
   January

Volume 7 (2004)
   November
   September
   July
   June
   May
   April
   March
   February (Part 2)
   February
   January (Part 2)
   January

Volume 6 (2003)
   December
   November (Part 2)
   November
   September
   August (Part 2)
   August
   July (Part 2)
   July
   June (Part 2)
   June
   May (Part 2)
   May
   April (Part 2)
   April
   March (Part 2)
   March
   February (Part 2)
   February
   January (Part 2)
   January

Volume 5 (2002)
   December (Part 2)
   December
   November (Part 2)
   November
   October (Part 2)
   October
   September (Part 2)
   September
   August (Part 2)
   August
   July (Part 2)
   July
   June (Part2)
   June
   May (Part 2)
   May
   April (Part 2)
   April
   March (Part 2)
   March
   February (Part 2)
   February
   January (Part 2)
   January

Volume 4 (2001)
   December (Part 2)
   December
   November (Part 2)
   November
   October (Part 2)
   October
   September (Part 2)
   September
   August (Part 2)
   August
   July (Part 2)
   July
   June (Part 2)
   June
   May (Part 2)
   May
   April (Part 2)
   April
   March (Part 2)
   March
   February (Part 2)
   February
   January (Part 2)
   January

Volume 3 (2000)
   December (Part 2)
   December
   November (Part 2)
   November
   October (Part 2)
   October
   September (Part 2)
   September
   August (Part 2)
   August
   July (Part 2)
   July
   June
   May
   April
   March
   February
   January

Volume 2 (1999)
   December
   November
   October
   September
   July
   June
   May
   April
   March
   February
   January

Volume 1 (1998)
   December
   November
   October
   September

 

CSS Tip:
Styling Lists With CSS

by Larisa Thomason,
Senior Web Analyst,
NetMechanic, Inc.

  
March 2004
Vol. 7, No. 5
 • Promotion Tip
 • Design Tip
 • CSS Tip
  

Lists are great way to emphasize important page content. Visitors use them to quickly scan the page for important information. Basic lists are useful, but you can add even more visual interest and prominence using CSS to style them. Just watch for some potential browser display problems.

Flexibility And Control With CSS

Cascading Style Sheets (CSS) give you a lot of flexibility and control over page layout and formatting. Use CSS to add background color, text color, custom bullets, borders, etc. to your lists. It's a great way to make them more visually prominent without using extra images or tables.

Let's take one of the example lists from our January 2004 Design Tip "Lists Visitors Love To Read" and spruce it up a bit using CSS properties.

Here's the original list:

The style rule below creates a class named "colorList" and adds a 2 pixel, solid, maroon border around a blue background with bold white text:

<style type="text/css">
.colorList
 {
  border-style:solid;
  border-width:2px;
  border-color:maroon;
  background-color:yellow;
  color:navy;
  font-weight:bold;
 }
</style>

Then apply the class to the opening UL tag:

<ul class="colorList">

Avoid Browser Display Problems

That seems pretty straightforward, doesn't it? But there's a problem: the code listed above isn't cross-browser compatible when the class is applied to the list itself.

  1. It displays reliably in Netscape, but not in Explorer and Opera. These two display issues can drive you crazy if you aren't aware of them:

  2. When the width property is applied to a list's style definition, none of the list's bullets or numbers will display in Explorer.

When the border property is used to add a border around a list, the bullets and numbers display outside the border in Explorer 6 and Opera 6.

For instance, here's how our example code displays in Netscape 6 and 7. It looks just as you would expect.

But look at the same list in Explorer 6. The border displays, but the bullets disappear because the WIDTH property is defined!

Here's Explorer 6 with a border but no width property set. The bullets are back but displayed outside the border and the list element extends all the way across the browser.

Correct Display Problems With A DIV

There's an easy fix for this problem: don't style the list itself.

  1. Create a class that adds the style definitions you want.
  2. Place the list inside opening and closing DIV tags.
  3. Apply the class to the DIV instead of the list.

Here's how that technique looks in Explorer 6.0:

Here's the code:

That simple addition of a single DIV tag gives you the display you expect in Explorer, Netscape, and Opera. Note that you may have to adjust the padding and margin around the list because some browsers add a bit of extra spacing when the list is inside a DIV tag.

But of course, first you have to know there's a problem before you can fix it. Finding browser display problems can be particularly tricky because you need access to many different operating systems, browsers, and browser versions to perform a complete test.

Large Internet companies have expensive testing labs and employees paid to make sure everything looks great before launch and after every change. But what about individual webmasters who can't afford that kind of set-up?

NetMechanic's Browser Photo tool gives you the resources of a complete testing lab at a small fraction of the price. You get to view actual screen shots of your Web pages in 16 different browsers, browser version, and operating system combinations.



Rate This Tip:
Not Useful Useful Very Useful   
 
NetMechanic Tools
HTML Toolbox
Browser Photo
Server Check
Search Engine Starter
Search Engine Tools
GIFBot
Newsletter
HTML Tutorial and Tips
Search Engine Tutorial
Accessibility Information
Browser Problem Tutorial

Company Info
Products
About Us
Contact
Advertise
Link To Us
Jobs
Privacy Policy
Partner Programs
Press Room
RSS Feed
Support
 



Powered by Overture!

 
     
 
   
 
     


Keynote Home
Copyright © 1996-2007,
Keynote NetMechanic
All rights reserved.