我在td
中設置了img
,width
和height
設置爲100%
。在Chrome中width
服從,但height
不符合。它似乎在所有其他瀏覽器中按預期工作。image在鉻中沒有遵守的高度尺寸
不知道爲什麼?
div
{
background-color: red;
width: 100px;
height: 100px;
}
table
{
width: 100%;
height: 100%;
}
img
{
width: 100%;
height: 100%;
}
<div>
<table border="1">
<tr>
<td>
<img src="https://www.google.com/images/srpr/logo11w.png" />
</td>
</tr>
</table>
</div>
心靈更新此琴告訴我你是什麼意思?我嘗試了你所擁有的,但沒有奏效。 http://jsfiddle.net/imthenachoman/kv4zpkuu/1/ – IMTheNachoMan
好的,在小提琴中更新。它需要一個div包裝圖像。 – Heroselohim
http://jsfiddle.net/heroselohim/qbLtaprc/ – Heroselohim