Answer the question
In order to leave comments, you need to log in
CSS: Separate styles for list text markers?
There is a list:
<ol><br/>
<li>First</li><br/>
<li>Second</li><br/>
</ol>
Answer the question
In order to leave comments, you need to log in
CSS3 has the ::marker pseudo-element.
In CSS2.1, you can do something like this:
ol {
counter-reset: li;
}
ol > li {
list-style:none;
position: relative;
}
ol > li:before {
content:counter(li);
counter-increment:li;
position: absolute;
left: -2em;
color: red;
font-weight: bold;
}
<ol>
<li><p> First
<li><p> Second
</ol>
ol {
color: red;
font-weight: bold;
}
ol p {
color: black;
font-weight: normal;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question