Different list style image for each li

2019-06-20 02:58发布

I've got a problem with some ul and li...
I'd like to create an unordered list with 3 li and each li has got a different list-style-image...
I wrote this code but the image don't appear...

Can you help me? Thanks!

EDIT: Post updated with HTML code ;)

<div id="right_main">
<ul id="mainFeatures">
<li id="wishlist">Some text here...</li>
<li id="sharing">Some text here...</li>
<li id="linking">Some text here...</li>
</ul>
</div>
#right_main ul#mainFeatures {
    height:250px;
    width:350px;
    overflow:hidden;
    margin-left:25px;
}
#mainFeatures li {
    font-weight:bold;
    font-size:22px;
    font-family:"Myriad Pro", sans-serif;
    padding:5px;
}
#mainFeatures li#wishlist {
    list-style-image:url(images/wishListImage.png);
    list-style-position:outside;
}
#mainFeatures li#sharing {
    list-style-image:url(images/sharingListImage.png);
    list-style-position:outside;
}
#mainFeatures li#linking {
    list-style-image:url(images/linkingListImage.png);
    list-style-position:outside;
}

4条回答
Evening l夕情丶
2楼-- · 2019-06-20 03:33
#check li {
    background: url(message.png) no-repeat -34px 7%;
    background-origin: content-box;
    background-size: 32px;
    float: left;
}
查看更多
劳资没心,怎么记你
3楼-- · 2019-06-20 03:34

Most likely, your images were cut off by overflow: hidden. I've removed that and it works now: http://jsfiddle.net/ahwhj/

查看更多
Juvenile、少年°
4楼-- · 2019-06-20 03:37

Use as background can be done too. Example http://jsfiddle.net/huhu/r7kSf/

查看更多
叼着烟拽天下
5楼-- · 2019-06-20 03:49

If your html doesn't show properly in stackoverflow, it may contain errors. Try posting without the code format.

查看更多
登录 后发表回答