唯一的文字而不是数字

时间:2013-08-31 17:30:56

标签: html css

如何用我独特的文字替换数字?让我们说代替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>

1 个答案:

答案 0 :(得分:-1)

这有点ha ..

如果要将数字替换为您想要的任何数字,首先要删除列表样式类型。

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 here.