1

如何用我的独特文本替换数字?让我们说而不是 1. , 2. , 3. 我想放 Bla , Blabla , Blablabla 。

http://i.stack.imgur.com/kf0p4.jpg

<style>
#menu2 {
width: 320px;
}
#menu2 ol {
font-style: talic;
font-family: Georgia, serif;
font-size: 24px;
color: #bfe1f1;
}
#menu2 ol li p {
padding:8px;
font-style: normal;
font-family: Arial;
font-size: 13px;
color: #eee;
text-align:left;
border-left: 1px solid #999;
}
#menu2 ol li p em {
display: block;
}
</style>
<div id="menu2">
<ol>
  <li><p><em>Jeden</em> Sed diam eu dui dolor, porttitor laoreet fermentum. Morbi laoreet, enim aliquam convallis. Donec ullamcorper, augue euismod convallis nisl. Etiam dictum sit amet tempus arcu.</p></li>
  <li><p><em>Dwa</em> Sed diam eu dui dolor, porttitor laoreet fermentum. Morbi laoreet, enim aliquam convallis. Donec ullamcorper, augue euismod convallis nisl. Etiam dictum sit amet tempus arcu.</p></li>
  <li><p><em>Trzy</em> Sed diam eu dui dolor, porttitor laoreet fermentum. Morbi laoreet, enim aliquam convallis. Donec ullamcorper, augue euismod convallis nisl. Etiam dictum sit amet tempus arcu.</p></li>
  <li><p><em>Cztery</em> Sed diam eu dui dolor, porttitor laoreet fermentum. Morbi laoreet, enim aliquam convallis. Donec ullamcorper, augue euismod convallis nisl. Etiam dictum sit amet tempus arcu.</p></li>
</ol>
</div>
4

1 回答 1

-1

这有点hackish..

如果你想用你想要的任何东西替换数字,你首先删除列表样式类型。

ul {
    list-style-type: none;
}

接下来,使用:before伪,以及:nth-child定位标记。

content: " "列表项之前的文本在哪里。

li:before {
    content: "ugh";
    padding-right:10px;
}
li:nth-child(2):before {
    content:"blah";
}
li:nth-child(3):before {
    content:"foo";
}

jsFiddle在这里。

于 2013-08-31T17:48:08.180 回答