2012-08-24 48 views
2

我使用jQuery来获取圆角在UI选项卡。我的问题是它运作良好,在Firefox和IE9,但在IE7和IE8(标签看起来像一个正方形。它是一个问题,大家还是有一个修复?圆角CSS标签上的角落里IE 7/8

<div id="fig"> 
     <div id="fig-tabs"> 
      <strong class="tab-current">1st tab</strong> <a href="" class="tab">2nd tab</a> <a href="" class="tab">3rd tab</a> 
     </div> 
...</div> 

和css是失败,

#fig-tabs { } 

strong.tab-current 
{ 
    background-color: #FFF; 
    padding: 3px 8px 7px 8px; 
    -moz-border-radius: 4px 4px 0px 0px; 
    border-radius: 4px 4px 0px 0px; 
    text-decoration: none; 
} 

a.tab 
{ 
    background-color: #999; 
    padding: 3px 8px 2px 8px; 
    -moz-border-radius: 4px 4px 0px 0px; 
    border-radius: 4px 4px 0px 0px; 
    text-decoration: none; 
} 

a.tab:hover { background-color: #9ffff; } 
+2

的乐事背景做 的经典方法是有你使用jQuery和,而不是仅仅CSS的原因吗?你可以发布一些代码的上[jsfiddle](http://jsfiddle.net),所以我们知道我们正在处理什么文件克与? –

+0

是,使用CSS,如果你必须支持IE 6-8,可以考虑使用CSS3 PIE - http://css3pie.com/。 – mg1075

+0

我现在使用css,我得到了与Ie7/8相同的问题。 – JNPW

回答

6

要开始我说你的问题是,你正在写的代码使用<canvas>标签/元素哪些老版本的Internet Explorer不支持。What you can use

为什么不直接使用CSS3 border-radius的属性来设置你的四舍五入e仍然不能在Internet Explorer中工作,但更好,更容易编码。真是这个时代这样的事情应该使用css3完成。有迹象表明,将前9

对IE的工作,如果你真的想在你将需要使用一个预先创建的图像旧的浏览器版本的圆角兼容库。

编辑:由于对方回答说,你可以使用Internet Explorer帆布库,但是你需要getContext呼叫改变你以下为动态生成你的canvas标签

var el = document.createElement('canvas'); 
G_vmlCanvasManager.initElement(el); 
var ctx = el.getContext('2d'); 

EDIT2:现在你问题在于IE 7/8中也不支持css3属性。尝试使用库(建议使用http://css3pie.com/将其添加到旧版浏览器中)

3

IE7/IE8不支持canvas元素,您可以使用库支持发现here。试试看。

0

怎么样使用上的div

<div><!--top--> 
    <div><!--repeat--> 
    <div><!--bottom--> 

    </div> 
    </div> 
</div>