IE 10坑爹两则

最近把公司电脑升级了IE 10,然后做某网页在firefox下调试,但到IE里面就出问题了。

第一个是给body设置box-shadow,然后min-height:100%,但IE的body上下都有margin,同时height:100%失效。

这个需要设置:

    html{height:100%} 
    body{ 
        box-shadow:0 0 5px #000; 
        padding:0; 
        margin:0; 
        min-height:100%; 
        height:100%; 
    } 

其中设置html的height为100%,但不设置body的height的话,firefox下显示正常,但IE 10虽然body的height是100%,但下面还是有margin,这是因为IE对min-height的解析,并不将它解析为height,因此必 须定义它。

第二个是fieldset,若设置border为none,则IE 10下面的legend元素下沉,没有那种冒出头的效果了,而这个在firefox下还是显示正常的,这个没有办法,只有设置border,但可以将 border颜色设置为透明transparent,如下:

    fieldset{ 
        border:1px solid transparent; 
    } 

只有这样才能hold住,正常显示。

但是这样会有1px的border,如果是进行像素级的定位,需要注意。

posted @ 2013-02-22 17:46  pockry  阅读(162)  评论(0编辑  收藏  举报