Pseudo :before/:after sprites
When using CSS sprites with pseudo elements, make sure you include these lines to ensure the sprite shows up:
HTML:
<div class="button">ENERGIZE!</div>
CSS:
.button:before {
content: "";
padding-left: 30px;
}
.button:after {
content: "";
padding-right: 30px;
}
My tip doesn't use float, but padding instead. Here's a good article of pseudo sprites that uses float on the pseudo element.
http://css-tricks.com/pseudo-spriting/
Written by Jo Chou
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#N
Authors
Related Tags
#n
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#