質問

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