Skip to content

Instantly share code, notes, and snippets.

@pocotan001
Created April 25, 2013 10:50
Show Gist options
  • Save pocotan001/5458934 to your computer and use it in GitHub Desktop.
Save pocotan001/5458934 to your computer and use it in GitHub Desktop.
ico.css
/*
# .ico-
*/
[class^="ico-"]::before,
[class*=" ico-"]::before {
display: inline-block;
content: "";
vertical-align: middle;
}
[class^="ico-"]:not(:empty)::before,
[class*=" ico-"]:not(:empty)::before {
margin-top: -0.25em;
padding-right: 5px;
}
/*
<p class="ico-a">text</p>
<i class="ico-a"></i>
*/
.ico-a::before {
width: 10px;
height: 10px;
background: url("ico_a.png") no-repeat;
background-size: 10px;
}
/*
<p class="ico-b">text</p>
<i class="ico-b"></i>
*/
.ico-b::before {
width: 12px;
height: 12px;
background: url("ico_b.png") no-repeat;
background-size: 12px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment