I have an ordered list in HTML.
I would like to add styling only to the numbers (1,2,3,…), and not to the list items themselves.
Is there a way to refer to these numbers ?
Thanks !
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
CSS2 provides for control over generated content, which will let you style the auto-generated content independently of the rest of the item using the
:beforepseudoclass. Here’s a solution that meet’s the OP’s follow-up criteria (background color on the list enumerator but not the item).