开发者

set 100% width and a maxwidth of 400px?

I want to do the folowing:

image.style.maxWidth = "400px";
image.style.width = "100%";

so the image maxwidth is 400px but if the user resizes his webbrowser window to a width of -400px the image will be resized to the same with as the window. The problem is: How do you this is non maxwidth browser? is there any way of doing this without using maxwith开发者_高级运维?


You can use this css3 rule:

@media only screen and (min-width: 768px) and (max-width: 991px) {

#image {
    width: 400px;
}
}

Go and check http://lessframework.com/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜