How do you set <ul> bullet's list-style to a code decimal?
I have a ul
that I want to set the bullet style of with the code decimal of ✓
(checkmark). Is there any way to do this? I tried list-style-image
, but it didn't work开发者_如何学运维.
You will need to apply a workaround here:
ul { list-style: none; }
ul li:before { content: "\2713"; }
Then adapt padding and margin of ul, li and li:before to your liking. This won't work in IE < 8, though. There you will have to use images or JavaScript (or putting it in the markup, if you really need to support them).
You can specify the type through list-style-type
(however you're limited to the pre-set values, otherwise if you want to use list-style-image
you must supply an image, not a character.
Otherwise, use the :before
selector as others have suggested.
Closest you can likely get is something hacky like:
ul {
list-style-type: none;
padding: 0;
}
ul li:before {
content: "\2713";
}
list-style-type
is what you are looking for.
精彩评论