Question

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.

Was it helpful?

Solution

Answer was pretty simple, this is my code now!

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

OTHER TIPS

You can add more css:

  1. remove width=100% include img tag.

  2. Add css:

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

done!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top