Skip to content

Instantly share code, notes, and snippets.

@pospi
Created September 24, 2013 01:18
Show Gist options
  • Save pospi/6679177 to your computer and use it in GitHub Desktop.
Save pospi/6679177 to your computer and use it in GitHub Desktop.
List bullets using font characters (best used with icon fonts!). Supported in everything except IE6 & 7, with graceful fallback.
ul {
list-style:none;
padding: 0 0 0 2em; /* padding includes space for character and its margin */
/* IE7 and lower use default */
*list-style: disc;
*padding: 0 0 0 1em;
}
ul li:before {
content: '\25BA';
font-family: "Courier New", courier, "Lucida Sans Typewriter", "Lucida Typewriter", monospace;
margin: 0 1em 0 -1em; /* right margin defines spacing between bullet and text. negative left margin pushes back to the edge of the parent <ul> */
/* IE7 and lower use default */
*content: none;
*margin: 0;
}
ul li {
text-indent: -1em; /* negative text indent brings first line back inline with the others */
/* IE7 and lower use default */
*text-indent: 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment