Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法控制网站上的图像大小?例如,如果图像超过 640x360,则显示为
<img src="image.jpg" width="640" height="360" />
但如果图像小于例如 256x256,则使用其本机高度和宽度显示它。
<img src="image.jpg" width="native" height="native" />
感谢帮助。
不会
img {max-width:640px;}
成为最简单的答案