Last active
August 29, 2015 14:05
-
-
Save skycaptain/4ffe5837c38bbde9fe54 to your computer and use it in GitHub Desktop.
CSS Responsive Hanging List Indents
This file contains 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
// Creates hanging indents for unordered list, without the need of defining a width or negative margin for the li:marker | |
.list-hanging { | |
margin: 0; | |
padding: 0; | |
list-style: none; | |
display: table; | |
> li { | |
display: table-row; | |
} | |
> li:before { | |
padding-right: 1em; | |
display: table-cell; | |
} | |
} | |
ul.list-hanging > li:before { | |
content: "\2022"; | |
} | |
ol.list-hanging { | |
counter-reset: nested_ol; | |
> li { | |
counter-increment: nested_ol; | |
} | |
> li:before { | |
content: counters(nested_ol, ".") "."; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment