문제

I am planning to redesign my site using the Flexible Box Layout Module to make it responsive since it seems to be the winning layout method for responsive sites.

But what happens if an image in one of the boxes are wider than the viewport? Can I automatically scale down the size of the image if the image is too wide for the viewport?

I haven't been able to find solid info on this topic. This may be a basic or bad question, I am not sure.

도움이 되었습니까?

해결책

Yes, as following:

img {
max-width: 100%;
height: auto;
width: auto\9; /* ie8 */
}

(although I'm not sure if necessary, since mobile devices scale down images themselves)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top