CSS3 uses counters to automatically add numbers. css3 counters
<! Doctype html>
<Html lang = "zh-CN">
<Head>
<Meta charset = "UTF-8">
<Title> CSS counters </title>
<Style type = "text/css">
Html {
Color: #444;
Font: 16px/1.6, "Microsoft YaHei ";
}
Ul {
List-style: none;
Padding-left: 3em;
}
. Menu {
Counter-reset: chapter;
}
. Menu> li {
Counter-increment: chapter;
Counter-reset: section;
}
. Menu> li: before {
Content: "chapter" counter (chapter ";
Padding-right:. 5em;
}
. Menu ul> li {
Counter-increment: section;
}
. Menu ul> li: before {
Content: "section" counter (section ";
Padding-right:. 5em;
}
</Style>
</Head>
<Body>
<Div> <A href = "http://www.999jiujiu.com/"> http://www.999jiujiu.com/</A> </div>
<Ul class = "menu">
<Li> ASP.net tutorial
<Ul>
<Li> variable </li>
<Li> function </li>
<Li> Object </li>
<Li> database </li>
<Li> output </li>
</Ul>
</Li>
<Li> java tutorial
<Ul>
<Li> variable </li>
<Li> function </li>
<Li> Object </li>
<Li> database </li>
<Li> output </li>
</Ul>
</Li>
</Ul>
</Body>
</Html>