开发者

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 &#10003 (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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜