IE不显示父元素边界之外的元素的背景

时间:2013-09-23 13:17:27

标签: css

我有一个容器div,它的溢出设置为可见,它有一个绝对定位在右上角的锚点,用作关闭按钮。问题是它应该在它的容器外面向上和向右坐,虽然它在chrome和ff中渲染得很好,但在IE中,这个锚的背景颜色没有显示出来。剩下的就是。看到这个jsfiddle,看看我的意思。

http://jsfiddle.net/QSSKs/

任何人都知道如何强制IE渲染完整背景?如果我重新定位锚点,使它完全位于容器div内,背景渲染得很好......但是我的位置关闭了。感谢。

这是我的html / css。

<div id="dvContainer">
    <a id="close" href="javascript:;">X</a>
</div>

#dvContainer{
     display:block;
    float:left;
    clear:none;
    width:800px;
    height:300px;
    border:solid 2px #fff;
    position:fixed;
    padding:20px;
    z-index:1100;
    -webkit-box-shadow:  0px 2px 1px 1px rgba(128, 128, 128, 0.2); box-shadow:  0px 2px 1px 1px rgba(128, 128, 128, 0.2);
    overflow: visible;
    box-sizing: content-box;
    -webkit-box-sizing: content-box;
    -moz-box-sizing: content-box;
    background: #f2f7fd; /* Old browsers */
    background: -moz-linear-gradient(top,  #f2f7fd 0%, #ccdbf0 100%); /* FF3.6+ */
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f2f7fd), color-stop(100%,#ccdbf0)); /* Chrome,Safari4+ */
    background: -webkit-linear-gradient(top,  #f2f7fd 0%,#ccdbf0 100%); /* Chrome10+,Safari5.1+ */
    background: -o-linear-gradient(top,  #f2f7fd 0%,#ccdbf0 100%); /* Opera 11.10+ */
    background: -ms-linear-gradient(top,  #f2f7fd 0%,#ccdbf0 100%); /* IE10+ */
    background: linear-gradient(to bottom,  #f2f7fd 0%,#ccdbf0 100%); /* W3C */
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f2f7fd', endColorstr='#ccdbf0',GradientType=0 ); /* IE6-9 */
}

#close 
{
    display: block;
    position: absolute;
    z-index: 1110;
    right: -10px;
    top: -10px;
    border: solid 3px white;
    background-color: red;
    font-size: 12pt;
    font-family: 'Trebuchet MS', arial, sans-serif;
    text-decoration: none;
    -webkit-box-shadow: 0px 2px 1px 1px rgba(128, 128, 128, 0.2);
    box-shadow: 0px 2px 1px 1px rgba(128, 128, 128, 0.2);
    color: white;
    text-shadow: 0px -1px 0px #990202;
    border-radius: 15px;
    width: 29px;
    height: 29px;
    text-align: center;
    background-clip: border-box;
    background-origin: border-box;
}

0 个答案:

没有答案
相关问题