Frage

HY! Is there any way to resize images who are 800px X 600px to fit conteiner size, but image who are 600px X 800px to stay normal. I'm using jQuery Cycle2 for page for accomodation and user can insert images via CMS. So there will be all kind of resolutions and I wona to horizintal images to strech, but vertical images to not.

War es hilfreich?

Lösung

Answer was pretty simple, this is my code now!

#Slider img{    
    max-width: 100%;
    height: 100%;
}

Andere Tipps

You can add more css:

  1. remove width=100% include img tag.

  2. Add css:

    .cycle-slide > img { height: 600px; width: 800px; }

done!

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top