Some special code forms of a sequence table in CSS

Source: Internet
Author: User
Tags lowercase

In the past, when we were dealing with a sequence or a number of sorted content, most of them were in front of the data by adding the previous value, or by the program plus this value. And if the use of a sequence table does not need to be so cumbersome, do not have to fill in the ordinal number, when the single-tier list of this feature does not seem obvious, and when the use of multiple layers of the characteristics are obvious. So let's take a look at the code form of a sequence table:

<ol>
<li>这就是列表的内容了,这是第一句</li>
<li>这就是列表的内容了,这是第二句</li>
<li>这就是列表的内容了,这是第三句</li>
<li>这就是列表的内容了,这是第四句</li>
<li>这就是列表的内容了,这是第五句</li>
</ol>

You can see that this form is the same as the unordered list, except that the name on the perimeter label is different. Disorderly is the UL, orderly becomes ol. The difference is that a sequential table will have more tag attributes than unordered. Because it's orderly, it involves all aspects of the order.

Change start value

In general, the browser will automatically sequence numbering from the Arabic numeral "1". And things have special, when the list needs to become two parts, then the next person to start numbering from scratch is not correct. The next part of the number is naturally based on the last number of the previous paragraph plus 1 for the start number. That means we need to change the starting value of the list. The attribute that changes the start value is: "Start", the formal writing is:

<ol start="6">
<li>这就是列表的内容了,这是第一句</li>
<li>这就是列表的内容了,这是第二句</li>
<li>这就是列表的内容了,这是第三句</li>
<li>这就是列表的内容了,这是第四句</li>
<li>这就是列表的内容了,这是第五句</li>
</ol>

It's been noted that the above code says that the starting value of the list starts at 6, so now you can try adding this property to a sequence of tables to see if it's changed.

Change numbering type

The default in the browser is usually Arabic numerals for the list number, then can there be other types? Yes, the property is "type", but there are not many types available, there are only five kinds:

Type value Build Style Sequence examples
A Capital A, B, C, D, E
A lowercase letters A, B, C, C, E
I Capital Roman Numerals I, II, III, IV, V
I Lowercase Roman Numerals I, II, III, IV, V
1 Arabic numerals 1, 2, 3, 4, 5
  

The code should be written in the following notation:

<ol type="A">
<li>这就是列表的内容了,这是第一句</li>
<li>这就是列表的内容了,这是第二句</li>
<li>这就是列表的内容了,这是第三句</li>
<li>这就是列表的内容了,这是第四句</li>
<li>这就是列表的内容了,这是第五句</li>
</ol>

I think that this type of value is still less used as a good, because the same type can be set with CSS. I have always advocated that style should be done by the style language. So unless you have a special reason, this is not a good attribute. Of course, whether it is CSS1 or CSS2 basically did not consider China, in the CSS2 has been for the provision of Japanese numbered characters, but there is no Chinese. I think there is a flaw in this CSS2, at least he did not provide a better form of expansion. Although he did not provide, but we can use our own form to achieve diversity. How do you do it?

Related Article

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.