Skip to content

Instantly share code, notes, and snippets.

@skycaptain
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skycaptain/4ffe5837c38bbde9fe54 to your computer and use it in GitHub Desktop.
Save skycaptain/4ffe5837c38bbde9fe54 to your computer and use it in GitHub Desktop.
CSS Responsive Hanging List Indents
// 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