سؤال

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.

هل كانت مفيدة؟

المحلول

Answer was pretty simple, this is my code now!

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

نصائح أخرى

You can add more css:

  1. remove width=100% include img tag.

  2. Add css:

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

done!

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top