Ex No: 11 AUTOMATIC NUMBERING
Aim: To design a webpage implement CSS counters for automatic numbering.
Algorithm
Step1: Create a folder “Ex11” to place the HTML files.
Step2: Create HTML file “index.html”.
Step3: Use CSS Counters property to create automatic numbering.
CSS Property Description
counter-reset reset the counter value to zero
counter-increment Increment the counter value by 1
content Content to be displayed with counter value
border Specify border property
border-radius Specify rounded corner radius
width, height Specify width and height value
font-size Specify size of the font
Source Code

index.html


<!DOCTYPE html>
<html>
<head>
  <title>Automatic Numbering</title>
    <style>  
    header {
      background: #333333;
      color: #fff;
      text-align: center;
      padding: 20px;
      border-radius: 10px 10px 0px 0px;
    }
    article {
      width: auto;
      border: 2px solid gray;
      padding: 10px;
      border-radius: 10px;
      margin: 5px;
    }
    footer {
      text-align: center;
      font-size: 12px;
      height: 50px;
      line-height: 50px;
    color: white;
      background: #333333;
      padding: 20px;
      border-radius: 10px;
    }
    body{
	 counter-reset: article;
    }
    h3::before{
      counter-increment: article;
      content: "Topic " counter(article) ". ";
    }
    article{
      counter-reset: section;
    }
    h4::before{
      counter-increment: section;
      content: counter(article)"."counter(section) " ";
    }
  </style>
</head>
<body>
  <header>
    <h1>Automatic Numbering</h1>
  </header>
  <article>
  <h3>Text Formatting</h3>
  <section>
    <h4>Text Color</h4>
    <p>CSS color property is used</p>
  </section>
  <section>
    <h4>Text Alignment</h4>
    <p>CSS text-align property is used</p>
  </section>
  <section>
    <h4>Text Shadow</h4>
    <p>CSS text-shadow property is used</p>
  </section>
  </article>
  <article>
  <h3>Fonts</h3>
  <section>
    <h4>Font Family</h4>
    <p>CSS font-family property is used</p>
  </section>
  <section>
    <h4>Font size</h4>
    <p>CSS font-size property is used</p>
  </section>
  </article>
  <footer>
  Developed by Dr. D. Natarajasivan
  </footer>
</body>
</html>

Result: Thus a webpage is designed to implement CSS automatic numbering successfully.