Log in

View Full Version : Responsive images



KennyP
09-13-2014, 09:38 AM
Would you guys please tell me why this css doesn't stop two images from wrapping?

The animated cup image followed by the "Guy Arseneau" image (that make up the logo,top left of screen) break onto two lines on small device screens.

Furthermore, why does the first image, the animated cup refuse to resize on smaller screens?

Website (http://www.guyarseneau.com/)

Thanks



#logo, #logo-map {

position:absolute !important;

top:20px !important;

left:20px !important;

background-repeat:no-repeat;

max-width:100%;

height:auto;

width:auto;

whitespace:nowrap;
}

Beverleyh
09-13-2014, 09:58 AM
Hi Kenny,

I can't double check at the mo because I'm on mobile but I'm pretty sure that its because you have width:auto; in the CSS.
That's only needed for IE8 so change it to width: auto\9; /* IE8 */ and hopefully the pics with 'respond'.

KennyP
09-13-2014, 10:54 AM
Hi Beverleyh - thanks for your reply.

I did make the width change to width: auto\9; /* IE8 */, but it's made for difference.

I find it strange that the second image(which is png) resizes perfectly, but the first image (which is a gif) doesn't seem to respond to anything I've tried. They're both in the same div with the same css.

Forgot to mention -- on the welcome/splash page there is another cup gif that will not resize as well.

KennyP
09-14-2014, 06:15 AM
Hi again Beverleyh - I finally realized what the problem was...

If one image is displayed, 100% max width assigned to it is fine. But if there are two images or more, the 100% has to be split amongst however number of images there are. So, the following is now working perfectly, whereas I'm also allowing 2% on each side of the two images in order to center them.

<div id="logo"><img src="/logo/loading-cup-header.gif" border="0" style="whitespace:nowrap; max-width:18%; height:auto"><img src="/logo/guy-arseneau-header.png" border="0" style="whitespace:nowrap; max-width:78%; height:auto"></div>

bornadl
09-19-2014, 07:26 AM
Thank. i had same problm.