safari中带有上边距的CSS问题
我无法在safari中获得最高利润。CSS工作正常,#divcontainer有上边距,在firefox和其他浏览器中居中,但在safari中没有 我想一个10px的空间,以显示上面的容器将容纳所有其他内容 以下是CSS:safari中带有上边距的CSS问题,css,safari,margin,Css,Safari,Margin,我无法在safari中获得最高利润。CSS工作正常,#divcontainer有上边距,在firefox和其他浏览器中居中,但在safari中没有 我想一个10px的空间,以显示上面的容器将容纳所有其他内容 以下是CSS: /* CSS Document */ body { color: #000000; /*This sets all text to Black*/ /*background-color: #FFFFFF; /*This sets the bacground
/* CSS Document */
body {
color: #000000; /*This sets all text to Black*/
/*background-color: #FFFFFF; /*This sets the bacground to white*/
margin: 100px auto; /*This sets the margin to zero*/
padding:0;
font-size:12px;
font-family:Verdana, Arial, Helvetica, sans-serif;
text-align:center;
}
p {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #000000;
}
h1 {
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
color: #000099;
}
h2 {
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
color: #000099;
}
h3 {
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
color: #000099;
}
.redtext {
color: #FF0000;
}
a {
color: #009900;
}
a:link {
color: #000099;
text-decoration: underline;
}
a:visited {
color: #666666;
text-decoration: none;
}
a:hover {
text-decoration: none;
background-color: #CCCCCC;
}
a:active {
text-decoration: none;
}
.menu {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
color: #000000;
}
.menu a:link {
color: #336600;
text-decoration: none;
}
.menu a:visited {
color: #666666;
text-decoration: none;
}
.menu a:hover {
color: #990000;
text-decoration: none;
}
.menu a:active {
color: #666666;
text-decoration: none;
}
div#container {
width: 960px;
height:760;
overflow:auto;
/*margin-left:0 auto; /* the auto value on the sides, coupled with the width, centers the layout */
}
div#outer {
margin-left: auto;
margin-right: auto;
width: 960px;
}
div#header {
position:relative;
text-align: center;
width: auto;
}
div#nav {
width: auto;
padding: 10px;
margin-top: 1px;
position:relative;
}
div#main {
position:relative;
width: auto;
}
div#footer {
position:relative;
width:auto;
padding: 15px;
margin: 0px;
}#nav {
position: relative;
padding:20px;
width: auto;
}
您可能需要设置边距:10px自动;在#容器上。通常,我会这样做:
body {
text-align: center;
padding: 0;
margin: 0;
}
#container {
width: 960px;
height: 760px;
text-align: left;
margin: 10px auto;
}
…假设#container div是第一个元素,应该可以解决这个问题
您可能还想试用其中一个css重置文件。您也可以发布html吗?您还需要在760 in div#container的高度后加上“px”,尽管我建议不要尝试作为一般规则来指定高度。新站点在这个HTML中,容器是一个类。在你的CSS中,你把它当作一个Id。html还没有开发好,我只是想让主容器正确地显示出来,然后从那里开始,这里是html