Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/cmake/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 图像不适合表格,IE中的td(IE8、IE9)在FF中效果良好_Css_Internet Explorer 8_Internet Explorer 9 - Fatal编程技术网

Css 图像不适合表格,IE中的td(IE8、IE9)在FF中效果良好

Css 图像不适合表格,IE中的td(IE8、IE9)在FF中效果良好,css,internet-explorer-8,internet-explorer-9,Css,Internet Explorer 8,Internet Explorer 9,你能帮我在桌子上贴一张图片吗,td高度。每当表格展开时,图像似乎保持其原始大小,并且不适合表格的宽度和高度。问题发生在IE8、IE9中。它在Firefox中似乎运行良好。请在下面找到html和css: HTML: 在html5中,img标签上的宽度和高度属性不能为%。我会尝试添加CSS规则,使图像的宽度/高度达到100% .special-offer-banner .special-offer-image img { display: block; width:100%; h

你能帮我在桌子上贴一张图片吗,td高度。每当表格展开时,图像似乎保持其原始大小,并且不适合表格的宽度和高度。问题发生在IE8、IE9中。它在Firefox中似乎运行良好。请在下面找到html和css:

HTML:


在html5中,img标签上的宽度和高度属性不能为%。我会尝试添加CSS规则,使图像的宽度/高度达到100%

.special-offer-banner .special-offer-image img {
   display: block;
   width:100%; 
   height:100%; 
}

谢谢你的快速回复。我按照您的建议进行了更改,但在IE中似乎不起作用。在图像的顶部和下方仍然存在空白。虽然它很好用。
.special-offer-banner {
border: 2px solid #333333;
width: 100%;
height: 120px;
margin: 5px 0;
display: table;
table-layout: fixed;
}

.special-offer-banner .special-offer-image {
width: 340px;
}

.special-offer-banner .special-offer-image img {
display: block;
}
.special-offer-banner .special-offer-image img {
   display: block;
   width:100%; 
   height:100%; 
}