Answers for "how to make counter in css and html"

CSS
0

css counters

body {
  counter-reset: section;                    /* On initialise le compteur à 0 */
}

h3::before {
  counter-increment: section;                /* On incrémente le compteur section */
  content: "Section " counter(section) " : "; /* On affiche le compteur */
}
Posted by: Guest on May-12-2021
0

counter html

<!DOCTYPE html>
<html>
<head>
<style>
body {
  counter-reset: section;
}

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

<h1>Using CSS Counters:</h1>
<h2>HTML Tutorial</h2>
<h2>CSS Tutorial</h2>
<h2>JavaScript Tutorial</h2>

</body>
</html>
Posted by: Guest on August-18-2021

Code answers related to "how to make counter in css and html"

Browse Popular Code Answers by Language