Created
December 22, 2017 09:47
-
-
Save leegee/791369a3ab089911461a5a5d7032fde3 to your computer and use it in GitHub Desktop.
CSS List item bullets with CSS background images
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
// Where flags.png is a sprite of 25x15 px images | |
// <nav id="language-selection"><ul><li class='en'> | |
#language-selection { | |
margin-left: 2em; | |
} | |
#language-selection ul { | |
list-style-type: none; | |
margin-left: 0; | |
padding-left: 0; | |
} | |
#language-selection li { | |
} | |
#language-selection li:before { | |
display: inline-block; | |
width: 25px; | |
height: 15px; | |
margin-right: 0.6em; | |
top: 2px; | |
position: relative; | |
content: ' '; | |
background: url('../assets/flags.png') no-repeat; | |
} | |
#language-selection li.en:before { | |
background-position: -25px 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment