对于一个学术网站,我想维护一个按类型(期刊文章、会议论文、研讨会论文等)细分的出版物列表,并根据出版物类型唯一编号,以便我可以在整个网站上引用它们.
Margin | Body
|
| ## Conference Papers
[C1] | Conference paper 1
[C2] | Conference paper 2
|
| ## Journal Articles
[J1] | Journal Article 1
我希望编号出现在页边空白处。我可以通过使用list-style-position:outside;
属性来实现这一点。但是,如果我使用该属性来实现自定义编号(例如 C1,而不是 1),这将不起作用list-style: none;
。使用自定义列表时是否可以将编号定位在主文本区域之外?
编辑:代码
ol {
list-style: none; counter-reset: item 1;
}
ol li:nth-of-type(1){
font-weight: normal;
}
ol li{
list-style-position:outside;
margin-left: 0px;
padding-left: 0px;
}
ol li:before {
content: "[C" counter(item) "] ";
color: green;
}
HTML:
<ol>
<li>Conference Paper 1</li>
<li>Conference Paper 2</li>
</ol>