Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Different list style image for each li

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;
}
like image 786
matteodv Avatar asked Dec 17 '10 20:12

matteodv


People also ask

What does list-style-image do?

The list-style-image CSS property sets an image to be used as the list item marker. It is often more convenient to use the shorthand list-style .

How many types of list styles are there?

list-style-type: disc|circle|square|decimal|lower-roman|upper-roman| lower-greek|lower-latin|upper-latin|lower-alpha|upper-alpha|none| inherit; Property values: disc:This is the default value.

How do I change the size of a list-style-image in CSS?

Approach 1: First, we will set the list-icon as background-image and we can customize its size using the height and width property. Example: HTML.


1 Answers

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

like image 76
Nikita Rybak Avatar answered Sep 17 '22 18:09

Nikita Rybak