CSS Counters

Total Post:2

Points:30
 662  View(s)
Ratings:
Rate this:

how to add counter using css styles. 

can anyone help me..

  1. Post:5

    Points:35
    Re: CSS Counters

    here is an example..of css counter 

    <style>
    
    body {
        counter-reset: section;
    }

    h2::before {
        counter-increment: section;
        content: "Section " counter(section) ": ";
    }
    </style>
    </head>
    <body>

    <h1>counter1</h1>
    <h2>counter2</h2>
    <h2>counter3</h2>

    hope this resolve your problem..

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!