Forum Moderators: not2easy

Message Too Old, No Replies

li issue in IE

li issue in IE

         

WElf

12:48 am on Jul 24, 2008 (gmt 0)

10+ Year Member



Hi.

have a small issue with a ul li. I am trying to set up two styles, one with a graphic bullet and one without.

CSS

#fulltext ul {
margin-left:40px;
padding-bottom:1em;
}

#fulltext ul li {
list-style: url(../images/bp.png) inside;
}

#fulltext ul li.nobullet {
list-style: none;
}

HTML

<ul>
<li class="nobullet">Sustainable</li>
<li class="nobullet">Moderation</li>
</ul>

This works fine Opera and firefox, but does not work in IE (6 or 7) where it displays the graphic. Any ideas what is wrong?

D_Blackwell

1:06 am on Jul 24, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Edit the following from:
#fulltext ul li.nobullet {
list-style: none;
}

to

#fulltext ul li.nobullet {
list-style-image: none; list-style-type: none;
}

The first piece removes the image, the second piece removes the default marker. It isn't enough to just go with list-style: or list-style-type:

<body>
<head>
<style>
#fulltext ul {
margin-left:40px;
padding-bottom:1em;
}

#fulltext ul li {
list-style: url(bullet-ball.gif) inside;
}

#fulltext ul li.nobullet {
list-style-image: none; list-style-type: none;
}
</head>
</style>
<body>
<div id="fulltext">
<ul>
<li>Sustainable</li>
<li class="nobullet">Moderation</li>
</ul>
</div>
<!--
have a small issue with a ul li. I am trying to set up two styles, one with a graphic bullet and one without.

This works fine Opera and firefox, but does not work in IE (6 or 7) where it displays the graphic. Any ideas what is

wrong?
-->
</body>
</html>

D_Blackwell

1:19 am on Jul 24, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



BTW - Another option would be set up different classes of for the <li>. Whether or not that is a good idea depends upon how many lists, how many items, what is easiest in the long run.

You could do something like:

#fulltext ul li.bullet {
list-style-image: url(../images/bp.png);
list-style-position: inside;
}

#fulltext ul li.nobullet {
list-style-type: none;
}

There are several choices. It depends upon what will be used most and least. The configuration used most should be set for the simplest call for the declaration.

WElf

2:08 am on Jul 24, 2008 (gmt 0)

10+ Year Member



Thanks. That helped heaps!