【发布时间】:2016-04-14 17:23:49
【问题描述】:
我有多个图像要连续显示,填充屏幕宽度:
<img src="1.jpg" style="max-width:25%">
<img src="2.jpg" style="max-width:25%">
<img src="3.jpg" style="max-width:25%">
<img src="4.jpg" style="max-width:25%">
在某些页面中,我有 4 张图片,但有些页面有 5、6 等。
我不想更改每个页面的最大宽度,那么这是 CSS 处理它的一种方式吗?
附言我不想使用 table 和 background-image,因为 js 插件需要将它们作为 img 查找,而且 img 标签也是谷歌友好的......
【问题讨论】:
-
只写 img { max-width:25%;高度:自动; } 在你的 CSS 代码中。
-
正如我所说,有些页面我有 5 张图片,需要 max-width:20%,当我有 100 多个类似页面时,这不是很可扩展,
标签: html css image width screen