IE CSS list formatting help

hatbocs

New Member
Messages
62
Reaction score
0
Points
0
I need some help with getting IE to display my lists right.

Here's the code I have for them:

Formatting
Code:
.postbody ul {
    margin: 8px;
    background-color: #444;
    list-style-position: inside;
    }
    
.postbody ul li {
    padding: 1px;
    margin: 0px;
    }
    
.postbody ol {
    margin: 8px;
    background-color: #444;
    list-style-position: inside;
    }
    
.postbody ol li {
    padding: 1px;
    margin: 0px;
    }
Text formatting
Code:
.postbody ul li {
    color: #fff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    line-height: 1.5em;
    list-style: url(images/bullet.gif);
    }

.postbody ul li a {
    color: #faa92e;
    text-decoration: none;
    border-bottom: dotted #aaa 1px;
    }
    
.postbody ul li a:hover {
    color: #fff;
    text-decoration: none;
    border-bottom: dotted #faa92e 1px;
    }

.postbody ol li {
    color: #ccc;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    line-height: 1.5em;    
    }
    
.postbody ol li a {
    color: #faa92e;
    text-decoration: none;
    border-bottom: dotted #aaa 1px;
    }
    
.postbody ol li a:hover {
    color: #fff;
    text-decoration: none;
    border-bottom: dotted #faa92e 1px;
    }

Here is IE (bad):
IElists.png

Here is Firefox (good):
FFlists.png
 
Last edited:

altrock182182

New Member
Messages
40
Reaction score
0
Points
0
Try margin-left instead of list-style-position. IE is notorious for messing up code with lists. It may not be semantically correct, but hey, if it works!

Code:
.postbody ul {
    margin: 8px;
    background-color: #444;
    margin-left:1em;
    }
    
.postbody ul li {
    padding: 1px;
    margin: 0px;
    }
    
.postbody ol {
    margin: 8px;
    background-color: #444;
    margin-left:1em;
    }
    
.postbody ol li {
    padding: 1px;
    margin: 0px;
    }
 

hatbocs

New Member
Messages
62
Reaction score
0
Points
0
That kind of helps. Turns out that it works better by changing the margin inside the li part.

.postbody ul li {
padding: 1px;
margin-left: 2em;
}

That puts it perfect in IE but now Firefox is 2em further to the right.

Should I just make a separate list (loaded with a conditional) for my lists or is there a hack I can do in my single stylesheet?

This is for a wordpress theme, too.
 

altrock182182

New Member
Messages
40
Reaction score
0
Points
0
Code:
.postbody ul li {
padding: 1px;
margin:0px;
margin-left: 2em;
}

Code:
.postbody ul li {
padding: 1px;
margin:0px;
padding-left: 2em;
}

Try these. If not, I might think of something in the meantime, or you could try a seperate .css for ie (with the IF IE comment conditionals)
 

hatbocs

New Member
Messages
62
Reaction score
0
Points
0
I did a little searching for css filters and found http://www.communis.co.uk/dithered/css_filters/css_only/index.html

So, it's probably not the prettiest method to use. But I prefer it over using the conditionals for IE.


Code:
/* IE Hack */
*html .postbody ul {
    margin: 8px;
    background-color: #444;
    }
    
*html .postbody ul li {
	padding: 1px;
	margin:0px;
	margin-left: 2em;
	}
    
*html .postbody ol {
    margin: 8px;
    background-color: #444;
    }
    
*html .postbody ol li {
    padding: 1px;
    margin: 0px;
	margin-left: 2em;
    }
/*End IE Hack*/
/*Normal*/
.postbody ul, [dummy="dummy"] {
	margin: 8px;
	background-color: #444;
	list-style-position: inside;
	}
	
.postbody ul li, [dummy="dummy"] {
	padding: 1px;
	margin: 0px;
	}
	
.postbody ol, [dummy="dummy"] {
	margin: 8px;
	background-color: #444;
	list-style-position: inside;
	}
	
.postbody ol li, [dummy="dummy"] {
	padding: 1px;
	margin: 0px;
	}
/*End Normal*/

Edit: The original normal part was blocking Opera too, didn't want that.

I don't know if it works with IE7 (I don't have it and would really prefer not to download it) but it seems to work the way I want it to.
 
Last edited:
Top