兩個Div,彼此重疊。如果我添加一些填充main-wrap-inner
股利然後它不重疊。但填充對所有瀏覽器來說都不是富有成效的。如何保護html元素重疊?
我有這個網站:
<div class="main-wrap">
<div class="main-wrap-inner">
<nav class="navbar aog-navbar"></nav>
</div>
<div id="fullpage" class="container charity-content">
<section></section>
<section></section>
</div>
</div>
而CSS是:
現在.main-wrap {
background: #ffffff none repeat scroll 0 0;
clear: both;
margin: 0;
min-height: 100%;
overflow: visible;
padding: 0;
position: relative;
}
.main-wrap-inner {
clear: both;
height: 100%;
min-height: 86px;
padding: 0;
position: relative;
width: 100%;
}
.main-wrap-inner {
height: auto;
min-height: inherit;
}
.aog-navbar {
-moz-border-bottom-colors: none;
-moz-border-left-colors: none;
-moz-border-right-colors: none;
-moz-border-top-colors: none;
background-color: #fff;
border-color: -moz-use-text-color -moz-use-text-color #ddd;
border-image: none;
border-style: none none solid;
border-width: 0 0 1px;
min-height: 100px;
z-index: 99;
}
.navbar {
margin-bottom: 20px;
position: fixed;
}
.charity-content, .charity-content .container {
max-width: 1220px;
width: 100%;
}
.charity-content {
padding-left: 0;
padding-right: 0;
}
問題是div
與fullpage
下div
要與main-wrap-inner
。 我如何保護這個重疊?
你可以擺弄這個? –
發生這種情況是因爲'.navbar'上的'position:fixed'。請參閱下面的答案 –