Solved

Unordered List apacing in IE and Firefox

Posted on 2006-06-25
4
920 Views
Last Modified: 2008-03-28
Hi,

I have a simple ul set up in html as follows :

        <ul>
             <li>Point One</li>
             <li>Point Two</li>
             <li>Point Three</li>
             <li>Point Four</li>
       </ul>


and in my CSS for the ul all I have is :

ul
{
  list-style-image: url(pathtogif/bull.gif);
  list-style-type: circle;
}

In Firefox this shows as nicely indented list using my gif.  In IE it also indents it (which I want), however, the spacing between the bukket points in IE is greatly reduced.

I guess I have a couple of questions :

a) What is the default padding/margin that it is applying

b) What values do I need to set in my CSS so that IE renders the list in the same way as Firefox ie. slightly more space between each li item

Cheers
0
Comment
Question by:JoHarris
  • 2
  • 2
4 Comments
 
LVL 30

Accepted Solution

by:
GrandSchtroumpf earned 250 total points
ID: 16978269
Note the the "bullet" is called a "marker".

Its location is controlled by the "marker-offset" CSS property:
http://www.blooberry.com/indexdot/css/properties/list/markeroff.htm

Unfortunately, a lot of browsers don't support that property...  If i remember correctly Opera supports it.  I don't know about Safari.

You can try adding some padding-left to the <li>...
Another solution is to use your image as background-image on your <li> and combine that with some margins and padding then you should get consistant behaviour on all browsers.

The default marker offset is completely different in IE and FF.  Seems like one calculates it from the left of the marker, the other from the right of the marker.  No matter what you do, you'll get inconsitant behaviour
0
 

Author Comment

by:JoHarris
ID: 16979117
Thanks for that.  How about the vertical spacing - is this a know problem too.

For example in ie the list displays as follows:

Point One
Point Two
Point Three
Point Four

Where as firefox displays it with more vertical space :

Point One

Point Two

Point Three

Point Four
0
 
LVL 30

Expert Comment

by:GrandSchtroumpf
ID: 16979905
using image markers is known to be inconsistant.
maybe you can use a background-image instead.
if you need to use one browser as a reference, use Opera or Safari... those are the browsers that best respect the standards.  Firefox is pretty good at respecting the standards too, but still has some bugs/mistakes, especially with lists items.
0
 

Author Comment

by:JoHarris
ID: 17004165
That's smashing - thanks for the help!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Box Model and Styling 12 34
targeting between desktop and responsive menu 3 32
HTML CSS 7 39
stop navigation from wrapping 7 58
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…

867 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now