通过一个有序列表CSS / HTML中的数字 [英] Striking through a number in an ordered list CSS/HTML
问题描述
我有一个HTML有序列表,我需要应用删除线。我在CSS中做到如下:
I have an HTML ordered list, that I need to apply a strikethrough to. I have done this in CSS as below:
.Lower-Alpha {
list-style: lower-alpha;
margin-top: 2pt;
margin-bottom: 2pt;
text-decoration: line-through;
}
我遇到的问题是这会触发列表中的内容,但不是列表的数量(我需要做这两个)。
The issue I am having is that this strikes through the content in the list, but not the number of the list (and I need to do both).
例如我得到:
a。
Eg I am getting:
a. struckthrough content
但我需要:
a。惊悚内容
欢迎任何建议。
Cheers
Any suggestions welcome. Cheers
推荐答案
很容易: list-style-position:inside; code>
easy as pie: list-style-position: inside;
http:// jsfiddle。 net / seler / NWbrR /
编辑:看起来像是依赖于浏览器的行为。
edit: it looks like it's browser dependent behaviour. in mozilla it renders ok.
edit2:
为了浏览器的兼容性,可以使用这个js脚本: http://jsfiddle.net/seler/32ECB/
这篇关于通过一个有序列表CSS / HTML中的数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!