我有一个重组的文本枚举列表,我用rst2html
导出到HTML:
#. My first point
#. My second, very important point
#. My third, very important point
#. My fourth point
我想强调第二点和第三点,这显然非常重要。这很容易完成:
#. My first point
.. class:: red
#. My second, very important point
#. My third, very important point
#. My fourth point
然而,这会重新开始编号(即第二个和第四个点将是1),而我想继续。有可能吗?
我已经考虑了内联角色:red:`important point
语法,但它并不适合我的方案(它是一个非常长的红点列表,我不想添加每行的内联角色)。
答案 0 :(得分:0)
这对我有用:
#. My first point
.. class:: red
#. My second, very important point
#. My third, very important point
#. My fourth point
但是,您不能为第一个项目设置一个类。
答案 1 :(得分:-1)
如何为每个重要的列表项添加一个类?
<li class="important">Important</li>
然后适当地设置样式?
如果你知道应该突出显示哪个项目,你也可以使用第n个孩子选择器
li:nth-child(2) {
color: red;
}