【发布时间】:2013-04-24 23:10:52
【问题描述】:
我遇到了一个我无法解决的问题,当我将Position:relative; 添加到一个 div 时,它会出现一个白色边框,或者像图像中的额外空间
如果我删除 Position:relative; 边框移动到也有 Position:relative; 的父级,这仅在 IE8 上。
标记:
<div class="content clearfix">
Some content goes here
<div class="block">
<div class="block_content" style="display: block;">
Some content goes here
</div>
</div>
</div>
CSS:
.content {
min-height: 100%;
height: 100%;
position: relative;
width:100%;
background-color:#ebebeb;
}
.block_content {
display:none;
position:relative;
margin: 25px 20px 15px 20px;
}
.block{
overflow:hidden;
width:58%;
padding-bottom:60px;
float:right;
position:relative;
margin-right:10%;
background: rgb(222,222,222); /* Old browsers */
background: -moz-linear-gradient(top, rgba(222,222,222,1) 0%, rgba(255,255,255,1) 0%, rgba(222,222,222,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(222,222,222,1)), color-stop(0%,rgba(255,255,255,1)), color-stop(100%,rgba(222,222,222,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(222,222,222,1) 0%,rgba(255,255,255,1) 0%,rgba(222,222,222,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(222,222,222,1) 0%,rgba(255,255,255,1) 0%,rgba(222,222,222,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(222,222,222,1) 0%,rgba(255,255,255,1) 0%,rgba(222,222,222,1) 100%); /* IE10+ */
background: linear-gradient(to bottom, rgba(222,222,222,1) 0%,rgba(255,255,255,1) 0%,rgba(222,222,222,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#dedede', endColorstr='#dedede',GradientType=0 ); /* IE6-9 */
box-shadow: 6px 6px 14px #333333;
-moz-box-shadow:6px 6px 14px #333333;
-webkit-box-shadow: 6px 6px 14px #333333;
}
演示链接:http://bank.benseno.com.tr/Sunus.html 任何帮助表示赞赏
【问题讨论】:
-
你试过
clear:both吗?不确定它是否有帮助,但这可能是问题 -
我想我做到了,会再试一次以确保
-
是的,还是一样,没有帮助:-(
-
.content的 z-index 为负,无论出于何种原因。它在 ie.css 中定义。当我停用它时,我没有得到白色边框。不过,我只能在 IE8 模式下测试 IE10,不能使用原始 IE8。 -
太奇怪了...如果(调试)我取消选中/再次检查:
body * {visibility:hidden;}所有页面消失并替换为黑色背景,但白色“边框”仍然存在。我勒个去。但行为取决于您选择的 DIV...(?)仍在搜索,希望我们可以帮助您解决这个奇怪的问题...
标签: html css internet-explorer internet-explorer-8