开发者

Auto scale image in html tag

Is there a way to get Firefox (or 开发者_运维技巧a browser in general) to scale an image in an HTML image tag automatically depending on the window size, and then expand the image to full size upon clicking on it, in the same way that the browser displays an image if you view it directly (right click and hit view image)?


You can't achieve the part where you want to make the image larger using click without some JS, but if you want the image to scale according to the browser size, you can use this in your CSS stylesheet:

img {
     max-width: 100%;
}

Read more about this here.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜