这是3个内联块。第一个是可扩展的,右边的两个块有固定的宽度。 如果我们调整浏览器的权限,无论如何应该是可见的。 #blockID应该适合页面,同时如果我们调整了窗口大小,图像应该是可扩展的。如何仅使用css缩放图像块?
我想在第一个块的图像可缩放。
我发现了几种使用JS的方法,但由于离散性,JS不适合。有没有一些技巧只使用CSS?
这里是我的代码(http://jsfiddle.net/t69f60s6/):
<div style="width: 100%; height: 300px; white-space: nowrap;" id="blockID">
<div style="max-width: 640;">
<div style="display: inline-block; height: 300px; max-width: 300px; width: 100%; background: #ffff00; position: relative; overflow: hidden;" id="pano">
<img src="https://c1.staticflickr.com/9/8697/17332403271_4122fda0b8_h.jpg" style=" top:0; left:0; width:100%; min-width: 100%; max-width: 100%; position: absolute; "/>
</div>
<div style="display: inline-block; height: 300px; width: 640px; background: #000;">
</div>
<div style="display: inline-block; height: 300px; width: 60px; background: #ff7870;">
</div>
</div>
</div>
更新1: 我已经改变了草书文字
更新2: 我可以使用表CSS实现这种效果。但桌子不好。 http://jsfiddle.net/6ng62eb7/4/
“*第一个是可扩展的,左边的一个是固定*”,第一个**是左边的......你可能是说右边的两个是固定的......?请澄清。 – LinkinTED
这里“左”是一个动词 - “过去”。 – AnthonyK
你能解释一下好吗?你想要对图像进行缩放比例?使足够大的3行内嵌块填充窗口宽度,无论它有多大,还是别的什么? –