[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


CSS UL has different left indent in FF and IE7

Posted on 2007-07-19
Medium Priority
Last Modified: 2012-06-27
ul has different left indent in FF vs IE.  In this case it looks correct in IE7 but has too much indent in FF.

Refer to the left list items and note the added indention in FF.

The ul and li css are:
ul { margin: 0px 0px 0px 20px; }
li { list-style: square; }

I've already tried adjusting the margin and if i change the left from 20px to 0px, it looks ok in FF but in IE7 the bullets overlap into the <td> to the left.

The container for this list is a table:
<table border="0" cellspacing="0" cellpadding="0" width="98%" style="padding: 0px; margin: 0px; spacing: 0px;">
      <td style="border: dashed 1px #0aa;">

I added the border's just for debugging...

I can't seem to get it to look the same for IE and FF.  I considered that there was some default padding or margins in one browser and not the other, but I've tried setting everything to zero and still get the same results.

Question by:jasonsbytes
  • 4
LVL 12

Accepted Solution

oceanbeach earned 2000 total points
ID: 19528139
Hello jasonsbytes,

Have you tried...

UL {
      MARGIN: 0px 0px 0px 20px;
      padding-left: 20px;

I hope this helps!

LVL 11

Expert Comment

ID: 19528227
usually, this sort of problem can be fixed by initializing all the margins, borders, and paddings to zero.
LVL 12

Expert Comment

ID: 19528233
Hello jasonsbytes,

Or a better idea, set the padding to 0 and adjust from there.


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

LVL 12

Expert Comment

ID: 19528239
Sorry JamesCssl, I type slow...
LVL 17

Author Comment

ID: 19528290
Hey guys!

JamesCssl: I tried that first as noted in the original post and no change.  Good thought though; that was my first thought too, but didn't work... :|
   "I can't seem to get it to look the same for IE and FF.  I considered that there was some default padding or margins in one browser and not the other, but I've tried setting everything to zero and still get the same results."

Oceanbeach:  Your first solution worked perfect...  That's very odd...  I went with 5px instead of 20 on the padding and that worked...  The strange part is that setting the padding only affected FF and not IE...
   MARGIN: 0px 0px 0px 20px;
   padding-left: 5px;

Thanks !
LVL 12

Expert Comment

ID: 19528594
Hi jasonsbytes,

That is strange...  Setting the UL padding to 0 seemed to 'zero' everything out for me.  I wonder why we seemed to get different results? Also,  I guess I  just picked 20px because of the margin.

I wish I could provide some more insight, but I am just glad I could help out!


Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
In this Micro Tutorial users will learn how to embed custom fonts into websites using @font-face in CSS Select a font: Ensure the EULA allows you to use @font-face: Download the font: Get the browser-compatible files you need: Edit your CSS       - Name …
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
Suggested Courses
Course of the Month19 days, 15 hours left to enroll

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question