W3C home > Mailing lists > Public > www-style@w3.org > June 2014

Background image cropping

From: Lajos Koszti <ajnasz@ajnasz.hu>
Date: Mon, 9 Jun 2014 11:27:41 +0200
Message-ID: <CAOL1FhscpjCQHVQE6NMYpXVVuUsgJhzaAKZ_axVUD9wCip7k_g@mail.gmail.com>
To: www-style@w3.org

I have an idea which could be useful for everyone.

Image sprites are pretty popular these days, where you add several
images to one image set as as a background image and crop it by
setting a fixed size of the element and moving the background image
behind it. Using the ::after and ::before you don't even need the
extra element into the HTML code.
However it's a hackish thing. You may want to use the ::after and
::before selectors for other purpose or you would need an icon from a
sprite for an element, where you can not use the ::after or ::before
like inputs.

So, a great solution would be to be able to define the area which is
visible from a background image. That would make possible to not add
extra elements from the DOM just to crop a background image, use
pseudo-elements to other then cropping an image and also we would be
able to use sprite with any element which can have a background image.

What do you think?

Lajos Koszti
Received on Monday, 9 June 2014 20:22:44 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:22 UTC