Mobile CSS Advice on Background Images please

HTML, CSS and anything else that deals with client side capabilities.

Moderator: General Moderators

Post Reply
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Mobile CSS Advice on Background Images please

Post 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).
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
Post Reply