Reputation: 35194
I would like to replace the regular html list item dot with an image from the jQuery UI icon sheet:
CSS:
li { padding: 0 0 0 5px; }
HTML
<ul>
<li class="ui-icon ui-icon-play">abc</li>
<li>abc</li>
</ul>
I don't see my text when I add the image class. What did I miss here?
http://jsfiddle.net/KKhZg/509/
Upvotes: 1
Views: 1742
Reputation: 4854
When you add class to li.ui-icon
it is going to get the width of ui-icon
which is defined 16px
.
I updated your fiddle.
Upvotes: 3
Reputation: 15319
As seemly said, you can insert a nested element inside the li
.
If you don't want to do that, just add these two rules to li
:
li {
text-indent: 16px !important;
overflow: visible !important;
}
http://jsfiddle.net/KKhZg/512/
16px
is the width of all jquery ui icons, so I guess you want your text indented after the icon.
I have put !important
because it seems that on jsfiddle, the jqueryUI is loaded after the user css, otherwise the text-indent
and overflow
would get overriden by the .ui-icon
Upvotes: 2
Reputation: 1090
That will be due to the text-indent on that class name. You may need to insert a nested element (maybe a span), and apply the icon class on that element instead.
Upvotes: 1