Page 1 of 1

Mobile CSS Advice on Background Images please

Posted: Fri Aug 16, 2013 9:33 am
by simonmlewis
We have a new site where most of the boxes on the page have background images.
The height is set, and the image is the width of the box. so overlays like buttons can be placed in front of the image, with text.

I'm trying to see how I can do this on a mobile site, where the width of the browser will vary.

I can set the DIV to be full width, but how to I set the height to be the height of the image, if I have it set to background-image: 100%, 100% ?

Is it just not feasible in a mobile site to use Backgrounds to fill a box? I guess it perhaps isn't, as it's nigh on impossible to position the width where text ends, so it doesn't go further than you wish (width or height).