position:absolute绝对定位引起的遮挡 求解决
三个层,div分别为
.HEAD
.MAIN
.FOOT
三个DIV层定位都是默认的。求怎么样让这个TAB下的内容不遮挡住FOOT层,小弟愚钝。求大神解决。能解决的直接发微信红包。小意思,但是心意绝对在!
QQ:64756341
其中,main里做了个选项卡TAB切换,tab切换的层 其中有个层定位为,position:absolute 导致遮挡住了最下面的.FOOT层。
TAB切换的完整代码为
<style type="text/css">
.goodstabs {
width: 100%;
height:100%;
float: none;
list-style: none;
margin: 0 0 10px;
text-align: left;
}
.goodstabs li {
float: left;
display: block;
}
.goodstabs input[type="radio"] {
position: absolute;
top: -9999px;
left: -9999px;
}
.goodstabs label {
display: block;
padding: 14px 21px;
border-radius: 2px 2px 0 0;
font-size: 20px;
font-weight: normal;
text-transform: uppercase;
cursor: pointer;
-webkit-transition: all 0.2s ease-in-out;
-moz-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
.goodstabs label:hover {
background: #d4eee1;
}
.goodstabs .tab-content {
z-index: 2;
display: none;
width: 100%;
font-size: 17px;
line-height: 25px;
padding: 25px;
position: absolute;
top: 55px;
left: 0;
background: #fff;
border-top: 1px solid #EBEBEB;
}
.goodstabs [id^="tab"]:checked + label {
top: 0;
padding-top: 17px;
background: url(/images/product-tab-bg.jpg)repeat-x;
color:#FFFFFF;
}
.goodstabs [id^="tab"]:checked ~ [id^="tab-content"] {
display: block;
}
</style>
<ul class="goodstabs">
<li>
<input type="radio" name="goodstabs" id="tab1" checked />
<label for="tab1">商品详情</label>
<div id="tab-content1" class="tab-content">
<p>{$goods.goods_desc}</p>
</div>
</li>
<li>
<input type="radio" name="goodstabs" id="tab2" />
<label for="tab2">猜您喜欢</label>
<div id="tab-content2" class="tab-content">
<p>选项卡内容 2</p>
</div>
</li>
<li>
<input type="radio" name="goodstabs" id="tab3" />
<label for="tab3">客户评价</label>
<div id="tab-content3" class="tab-content">
<p>选项卡内容 3</p>
</div>
</li>
<li>
<input type="radio" name="goodstabs" id="tab4" />
<label for="tab4">成交记录</label>
<div id="tab-content4" class="tab-content">
<p>选项卡内容 444</p>
</div>
</li>
</ul>
.HEAD
.MAIN
.FOOT
三个DIV层定位都是默认的。求怎么样让这个TAB下的内容不遮挡住FOOT层,小弟愚钝。求大神解决。能解决的直接发微信红包。小意思,但是心意绝对在!
QQ:64756341
其中,main里做了个选项卡TAB切换,tab切换的层 其中有个层定位为,position:absolute 导致遮挡住了最下面的.FOOT层。
TAB切换的完整代码为
<style type="text/css">
.goodstabs {
width: 100%;
height:100%;
float: none;
list-style: none;
margin: 0 0 10px;
text-align: left;
}
.goodstabs li {
float: left;
display: block;
}
.goodstabs input[type="radio"] {
position: absolute;
top: -9999px;
left: -9999px;
}
.goodstabs label {
display: block;
padding: 14px 21px;
border-radius: 2px 2px 0 0;
font-size: 20px;
font-weight: normal;
text-transform: uppercase;
cursor: pointer;
-webkit-transition: all 0.2s ease-in-out;
-moz-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
.goodstabs label:hover {
background: #d4eee1;
}
.goodstabs .tab-content {
z-index: 2;
display: none;
width: 100%;
font-size: 17px;
line-height: 25px;
padding: 25px;
position: absolute;
top: 55px;
left: 0;
background: #fff;
border-top: 1px solid #EBEBEB;
}
.goodstabs [id^="tab"]:checked + label {
top: 0;
padding-top: 17px;
background: url(/images/product-tab-bg.jpg)repeat-x;
color:#FFFFFF;
}
.goodstabs [id^="tab"]:checked ~ [id^="tab-content"] {
display: block;
}
</style>
<ul class="goodstabs">
<li>
<input type="radio" name="goodstabs" id="tab1" checked />
<label for="tab1">商品详情</label>
<div id="tab-content1" class="tab-content">
<p>{$goods.goods_desc}</p>
</div>
</li>
<li>
<input type="radio" name="goodstabs" id="tab2" />
<label for="tab2">猜您喜欢</label>
<div id="tab-content2" class="tab-content">
<p>选项卡内容 2</p>
</div>
</li>
<li>
<input type="radio" name="goodstabs" id="tab3" />
<label for="tab3">客户评价</label>
<div id="tab-content3" class="tab-content">
<p>选项卡内容 3</p>
</div>
</li>
<li>
<input type="radio" name="goodstabs" id="tab4" />
<label for="tab4">成交记录</label>
<div id="tab-content4" class="tab-content">
<p>选项卡内容 444</p>
</div>
</li>
</ul>
...全文
相关推荐
绝对定位元素被遮挡的解决方法
需要注意的是,z-index属性只有在元素的position属性被设置为relative、absolute或fixed时才有效。
如何解决IE6/7绝对定位元素神秘消失或被遮挡的方法
在网页开发过程中,尤其是针对老版本的Internet Explorer(如IE6和IE7)时,开发者可能会遇到一个棘手的问题:绝对定位元素在这些浏览器中神秘消失或者被其他元素遮挡。
浮动里的绝对定位元素在IE下被遮挡的解决方法
**更改Z-index**:z-index是决定元素层叠顺序的关键属性。增加绝对定位元素的z-index值,使其高于浮动元素,可以解决遮挡问题。
IE绝对定位元素神秘消失或被遮挡的解决方法
IE绝对定位元素神秘消失或被遮挡的解决方法"这一问题主要涉及到CSS中的相对定位、绝对定位以及浮动元素的相互影响。首先,我们需要理解相对定位和绝对定位的概念。
最顶层div被flash或者下拉列表遮挡的问题解决
; z-index:1;}#b{ position:absolute; top:70px; left:160px; z-index:0;}```在这个例子中,`#a`的`z-index`值为1,而`#b


