How to add section numbers (1.2, 3.4.1) automatically using CSS?
I currently have
h1, h2, h3, h4 {
font-weight: normal;
}
h1 { font-size: 140%; }
h2 {
Hey now you can used CSS counter-increment Property
As like this Css
body {counter-reset:section;}
h1 {counter-reset:subsection;}
h1:before
{
counter-increment:section;
content:"Section " counter(section) ". ";
font-weight:bold;
}
h2:before
{
counter-increment:subsection;
content:counter(section) "." counter(subsection) " ";
}
HTML **
Note: IE8 supports these properties only if a !DOCTYPE is specified.
HTML tutorials
HTML Tutorial
XHTML Tutorial
CSS Tutorial
Scripting tutorials
JavaScript
VBScript
Heading
One
Two
**
Live demo http://jsfiddle.net/PfcX2/1/
More info click here https://developer.mozilla.org/en-US/docs/Web/CSS/counter-increment