HTML and CSS Reference
In-Depth Information
are some ways around this problem, none of them are very e ! cient or even
worthy of recommendation.
What CSS sprites need in order to truly flourish is a CSS solution for
cropping an image. Such a property should define a crop operation on a
given background image before the image is used for further CSS
processing. This way, it would be easy to crop the desired image from the
sprite and position it accordingly, repeating it as needed; we'd be done with
these :before and :after hacks because there wouldn't be anything left
to hide. A solution has been proposed in the Editor's Draft of the CSS Image
Values and Replaced Content Module Level 3 (section 3.2.1), but it could
take months, even years, for this to become readily available.
For now, the LESS mixins above should prove pretty helpful if you plan to
use CSS sprites. Just remember to prepare your sprite well; if you do, things
should move ahead pretty smoothly, even when deadlines are weighing on
you.
Search WWH ::




Custom Search