Created
March 30, 2013 13:28
-
-
Save hemantajax/5276680 to your computer and use it in GitHub Desktop.
custom list styling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<title>custom list styling</title> | |
<meta charset="utf-8" /> | |
<style> | |
#wrapper{ | |
background: #eee; | |
width: 80%; | |
border: 1px solid #ccc; | |
margin: 20px auto; | |
} | |
ol{ | |
counter-reset: item; | |
padding: 0 0 1em 1em; | |
} | |
ol li{ | |
display: block; | |
margin-bottom: 5px; | |
} | |
ol li:before{ | |
display: inline-block; | |
content: counter(item) ") "; | |
counter-increment: item; | |
width:1.5em; | |
} | |
/********sub list ***********/ | |
.sublist{ | |
counter-reset: subitem; | |
} | |
.sublist li{ | |
display: block; | |
} | |
.sublist li:before{ | |
display: inline-block; | |
content: counter(item) "." counter(subitem) ":"; | |
counter-increment: subitem; | |
width: 2em; | |
} | |
</style> | |
</head> | |
<body> | |
<div id="wrapper"> | |
<ol> | |
<li>mu</li> | |
<li>kjkjkj,</li> | |
<li>jsjfjshfjsdhfsdf sdfds</li> | |
<li>MY Sub list | |
<ul class="sublist"> | |
<li>sblist</li> | |
<li>two</li> | |
<li>three</li> | |
</ul> | |
</li> | |
<li>no prob</li> | |
</ol> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment