CSS3边框半径和Internet Explorer 8 [英] CSS3 border radius and Internet Explorer 8

查看:125
本文介绍了CSS3边框半径和Internet Explorer 8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的网页使用CSS3 border-radius样式,我希望它在跨主要浏览器,包括IE8的跨浏览器兼容。



因此,我试图使用border-radius.htc文件来实现这一点。无论在我的CSS样式中使用border-radius,我都编码了:

  -webkit-border-radius:6px 6px 6px 6px; 
border-radius:6px 6px 6px 6px;
behavior:url(border-radius.htc);不幸的是,当我在IE8中检查网页时,所有具有border-radius行为的背景都会结束。



网页位于 http://www.domainandseo.com/portfolio/dominos/index.html



任何建议都非常感激。

解决方案

我不知道你正在使用border-radius.htc文件,但如果你使用 CSS3 PIE ,它是已知问题。从他们的页面:


我知道解决这个问题的唯一方法是:




  • 使目标元素位置:relative,或

  • 使祖先元素位置:relative,并为其赋予z-index。



这两种解决方法在子元素定位和z-index堆叠方面都有潜在的不良副作用。 PIE很容易强迫一个或另一个本身,但:




  • 根据具体情况,一个或另一个可能更合适, CSS作者需要能够控制选择哪一个。

  • 强制位置:CSS之外的相对位置会使IE与其他浏览器不同步,导致混乱的不一致。



I am using CSS3 border-radius styles in my webpage and I want it to be cross-browser compliant across major browsers including IE8.

Therefore, I am trying to use the border-radius.htc file to achieve this. Wherever in my css styles the border-radius is used, i have coded something like:

   -webkit-border-radius: 6px 6px 6px 6px;
    border-radius: 6px 6px 6px 6px; 
    behavior:url(border-radius.htc);

Unfortunately, when I check the webpage in IE8, all the backgrounds that have border-radius behavior end up not showing at all.

The webpage is at http://www.domainandseo.com/portfolio/dominos/index.html

Any suggestions would be highly appreciated.

解决方案

I don't known which "border-radius.htc" file you're using, but if you're using something like CSS3 PIE, it's a known issue. From their page:

The only way I know of to work around this is to either:

  • make the target element position:relative, or
  • make the ancestor element position:relative and give it a z-index.

Both of these workarounds can have potential unwanted side-effects in terms of child element positioning and z-index stacking. PIE could easily force one or the other itself, but:

  • One or the other may be more appropriate depending on the particular situation, so the CSS author needs to be able to control which one gets chosen.
  • Forcing position:relative outside of the CSS would put IE out of sync with other browsers, leading to confusing inconsistencies.

这篇关于CSS3边框半径和Internet Explorer 8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆