开发者

Fluid image resizing in CSS (or JS?)

开发者 https://www.devze.com 2023-01-08 12:06 出处:网络
I\'m trying to show a fairly large image on a page on my site. I want it to be re-sized dynamically depending on the user\'s resolution, so t开发者_运维百科hat it takes up the same percentage of scree

I'm trying to show a fairly large image on a page on my site. I want it to be re-sized dynamically depending on the user's resolution, so t开发者_运维百科hat it takes up the same percentage of screen on every monitor. How would I do that?


Set image width to a percentage.


Use the percentage values rather than pixels:

<img src="path here" width="100%" />
0

精彩评论

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

关注公众号