1. About.com
  2. Computing & Technology
  3. Web Design / HTML

Discuss in my forum

Jennifer Kyrnin

Indenting Lists Consistently Across Different Browsers

By , About.com Guide   July 3, 2009

Follow me on:

Indenting lists is one of those frustrating aspects of the browser wars. Browsers like Opera and IE give the UL or OL element some left margin, while browsers like Firefox and Safari give the UL or OL element some left padding. So, when you're testing your Web pages in one browser or another, it can be very frustrating to change the margins of your UL and have Firefox ignore you. But with CSS you can learn to indent lists and have your changes look the same in most browsers.

More About Indenting Lists

Comments
July 4, 2009 at 1:04 pm
(1) Alexander says:

Nasty at first, but once you understand it and get used to it, it doesn’t even bother you. (At least that’s how it is with me. ) You would probably just zero-out both of them and set whatever property suits you. It’s the same concept the with headings’ top margins, I believe.

July 5, 2009 at 9:25 am
(2) Darrin says:

I tend to use a reset style sheet to bring all (most) browsers into line, and then work off a blank slate of default style settings; so all lists are initially set to zero padding and zero margins. From there I set text-indent, paddings, margins, etc.

Some would argue a reset style sheet is a bit overkill, but it does “solve” the problem of browser inconsistencies nicely.

Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

©2012 About.com. All rights reserved. 

A part of The New York Times Company.