CSS3 uses counters to automatically add numbers. css3 counters

Source: Internet
Author: User
Tags add numbers

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>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.