css - Wordpress 精选图片在 IE8 中不显示

标签 css wordpress internet-explorer-8

我在使用 IE8 时遇到问题:它不显示此网站上的特色图片:http://www.melisayavas.com/news/

这是我的 functions.php 中用于输出特色图片的代码:

if ( function_exists( 'add_theme_support' )) {
    add_theme_support( 'post-thumbnails' );
}

if ( function_exists('add_image_size')) {
    add_image_size('news-thumb', 200, 200);
}

这是用于特色图片的 CSS:

.post-thumb {
    float: left; 
    padding: 10px;
}

特别针对 IE8 我有这个 CSS:

.post-thumb img {
    float: left\9;
    margin-top: 10px\9;
    margin-right: 10px\9;
}

如果我向 .post-thumb 元素 添加边距或宽度,图像会显示在 IE8 上,但我不需要固定的宽度或高度。我不明白为什么它不获取图像的宽度和高度。

最佳答案

问题是由这条规则引起的:

img, object, embed {
    max-width: 100%;
}

如果您从此规则中删除 img,该图像将出现在 IE8 中。

关于css - Wordpress 精选图片在 IE8 中不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10573458/

相关文章:

html - 边框底部的位置标题

html - CSS 叠加关闭按钮响应

ajax - 如何在 wordpress ajax 请求处理程序中设置 cookie?

css - 更改菜单项的文本颜色,仅在悬停时

html - 使用@font-family 的 Lato 字体未出现

php - 如何一起概述选项卡和内容

html - 悬停时更改图像并保留文本

javascript - 以编程方式更改文本框值时 IE8 触发更改事件

css - 如何在 Internet Explorer 8 中删除单选按钮周围的框

css - 调整图像大小的 float 文本在 IE8 中失败