【问题标题】:IE8 bug - borders and width on floated imageIE8 错误 - 浮动图像的边框和宽度
【发布时间】:2012-02-28 17:09:02
【问题描述】:

奇怪的是,我在 IE8 上而不是在 IE7 上出现了这个错误,它显示得很好:

http://www.axiscirugiadecolumna.com/

我正在为 shadow+ribbon 使用 wordpress 插件(我在 shadow 插件中对功能区进行了硬编码)。边框只是 css,但在 IE8 上,右边框不会出现,我只是不知道为什么。

我的 html 如下:

<div class="alignright" style="overflow:hidden;display:table;line-height:0;text-align:center;width:453px;">
   <div class="ribboncontainer">
       <div class="ribbon"></div>
       <img height="297" width="453" style="padding:0 !important; margin:0 !important; max-width:100% !important;" alt="" src="http://www.axiscirugiadecolumna.com/wp-content/uploads/2011/11/foto1.png" title="foto1" class=" size-full wp-image-143 shadow_curl">
       <br><img style="margin:0 !important;height:10px;width:100%;-moz-opacity:.75;opacity:.75;" class="shadow_img" src="http://www.axiscirugiadecolumna.com/wp-content/plugins/shadows/shadow_curl.png">
   </div>
</div>

这是在应用插件之后。内联样式由插件应用。

还有我的 CSS:

.alignright, .aligncenter, .alignleft {
   margin: 5px;
   padding-right: 5px;
   float: right;
 }
 .ribbon {
   background-image: url("ribbon.png");
   bottom: 21px;
   height: 40px;
   position: absolute;
   right: -5px;
   width: 154px;
   z-index: 888;
 }
 .ribboncontainer {
    position: relative;
 }
 .shadow_curl {
    border: 6px solid #BAD5BC;/*Right border is missing in IE*/
  }

我认为即使我摆脱了功能区类和 div,问题仍然存在。

【问题讨论】:

  • 你能发布实际代码吗?这是一个社区,一旦你的代码被修复或者你的网站永远消失,这个问题的未来访问者将不知道发生了什么。
  • 是的,对不起,我想过,我应该这样做。我没有偷懒,我会编辑我的问题。

标签: css wordpress internet-explorer


【解决方案1】:

嗯,这是因为 IE8(我还在 IE7 上测试了您的页面)——并且两者都不支持您的文件 style.css(第 171 行)中的 CSS 规则“box-shadow”。 如果你坚持使用投影(我假设),你应该为这些浏览器使用透明的 png/gif 文件。请记住,IE6 不支持原生 png 文件,所以最好使用 gif。

【讨论】:

  • 这不是盒子阴影问题,而是边框。现代浏览器有阴影,我不在乎它是否在 IE 上消失。图片下方的阴影是真实图片。
【解决方案2】:

删除那个

max-width: 100%;

style.css(第 894 行) img.size-auto、img.size-full、img.size-large、img.size-medium、.attachment img

【讨论】:

  • 看看有一个 max-width:100% !important 内联添加
  • 不,我从所有地方删除了它,但仍然没有:/
  • oops max-width:100% !important 仍然存在 'axiscirugiadecolumna.com/wp-content/uploads/2011/11/foto1.png" complete="complete"/>' 也在 img.size-full style.css 中
  • 是的,我把它放回去以防万一它破坏了其他东西,但在没有它之前手动尝试过。
猜你喜欢
  • 1970-01-01
  • 2013-04-03
  • 1970-01-01
  • 2013-01-31
  • 2016-08-02
  • 1970-01-01
  • 1970-01-01
  • 2011-12-30
  • 1970-01-01
相关资源
最近更新 更多