This article mainly introduces the usage of ol tag in HTML5, which is the basic knowledge for introductory learning of HTML5. Friends in need can refer to the definition and usage of
<ol> <li>Coffee</li> <li>Tea</li> </ol> <ol> <li start="60">Coffee</li> <li>Tea</li> </ol>
##The OL tag sequence number provided by HTML5 The control
OL tag displays data in the form of an ordered list, and it automatically adds numbers to the data. But sometimes the data is not numbered starting from 1, or the numbers are arranged in reverse order, or the numbers are completely messy. In this case, you need to use some parameters provided for the OL tag in HTML5 to set. Unfortunately, it is currently not compatible with IE. Now, we have a
HTML document like this
<ol> <li>土豆</li> <li>洋葱</li> <li>胡萝卜</li> <li>里脊肉</li> </ol>
It will appear like this
<ol reversed="reversed"> 这个是继承自XHTML的写法,其实可以直接写 <ol reversed>
Next, what if you don’t want it to start from 1? For example, if we want it to start from 3, we can add the start attribute to the OL tag and set it to 3.
<ol start="3">
<ol> <li value="2">土豆</li> <li value="1">洋葱</li> <li value="3">胡萝卜</li> <li value="4">里脊肉</li> </ol>
The above is the detailed content of Detailed explanation of the usage of ol tag in html5. For more information, please follow other related articles on the PHP Chinese website!