在CSS(或JS?)中调整流体图像大小 [英] Fluid image resizing in CSS (or JS?)
本文介绍了在CSS(或JS?)中调整流体图像大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正试图在我网站的页面上显示一个相当大的图像。我希望根据用户的分辨率动态调整大小,以便在每个监视器上占用相同百分比的屏幕。我该怎么做?
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 that it takes up the same percentage of screen on every monitor. How would I do that?
推荐答案
使用百分比值而不是像素:
Use the percentage values rather than pixels:
<img src="path here" width="100%" />
这篇关于在CSS(或JS?)中调整流体图像大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文