25 March 2014

How to Write Decimal Sequence in Order List in html using css


For writing documents, sometimes we need ordering serial as 1.1,1.2,1.3 etc

We can do this serial in html with the help of CSS.



Check this code below:


<!DOCTYPE html>
<html>
<body>
<style>
OL { counter-reset: item }
LI { display: inline }
LI:before { content: counters(item, ".") " "; counter-increment: item }
</style>

<ol start="1">Section
<li><ol start="1">
Section<li></li><br/>
Section<li></li><br/>
Section<li></li><br/>
</ol>
</li>
</ol>

</body>
</html>

Check the Output:

Output of about html code


(If you found this article useful then share with your friends.)

No comments: