【发布时间】:2015-05-29 02:53:49
【问题描述】:
让我的 div 将页面下移 30 像素/在我的 div 顶部添加 30 像素的边距时遇到问题。我的 div 使用自动边距在页面中心对齐。
但是,当我尝试添加这行代码时: 边距:30px 自动 0 自动;
没有显示上边距?请问有人可以告诉我我做错了什么吗?谢谢,
#content_other{
width:790px;
height: auto;
font-family: 'Arial Narrow', Tahoma, Verdana, Arial Narrow, sans-serif;
font-size:12px;
margin: 30px auto 0 auto;
position:relative;
overflow: hidden;
padding:20px;
background:#fff;
border: 1px solid #999;
-webkit-box-shadow: 0 3px 8px rgba(0, 0, 0, .25);
-moz-box-shadow: 0 3px 8px rgba(0, 0, 0, .25);
box-shadow: 0 3px 8px rgba(0, 0, 0, .25);
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
html:
<div id="content_other">
<html form here>
</div>
【问题讨论】:
-
它在谷歌浏览器中对我有用
-
你的代码绝对没问题 :) 但是让我知道你在哪个浏览器中遇到了这个问题。