It seems that every browser rendering engine has a completely different way of rendering lists. I recently had the frustrating job of getting them all to play nicely together.
The CSS I ended up using is quite simple and works across all the browsers I tested (list at the bottom).
This is the magic bit of CSS:
ul, ol {
list-style-position: outside;
margin: 0 0 0 15px;
padding: 0;
}
ol {
margin-left: 20px;
*margin-left: 24px; /* targeted IE 6, 7 fix */
}
li {
margin: 0;
padding: 0;
}
This CSS forces all the browsers to play by the same rules. The end results are nice and clean.
The left margins are necessary to get all the browsers to not clip part of the bullet/number; however, you can change this left margin on ul/ol elements contained within the primary ul/ol if you need to adjust the indentation of each sub-list.
Each browser that I tested rendered the same thing, albeit with slightly different bullets or padding in front of the number.
The following are the browsers I tested:
- OS X
- Firefox 3.5
- Safari 4
- Ubuntu (Linux)
- Firefox 3.5
- Google Chrome 4
- Konqueror 4.2
- Midori 0.1.2
- Opera 10
- Windows
- Firefox 3.5
- Google Chrome 4
- Internet Explorer 6, 7, and 8
- Safari 4