我对CSS和HTML很陌生。这个问题很简单,但是我很忙。
我有一个<section>
标签,position:fixed
当向下滚动页面时,该标签保持不变。
但是此部分在末尾与页脚重叠,我不希望它发生。
这里的代码:
<!-- section tag -->
<section class="fix">
<header>
<h2>Corsi</h2>
</header>
<div class="row">
<section class="6u">
<ul class="default">
<li><a href="#">softwares</a></li>
<li><a href="#">others</a></li>
</ul>
</section>
</section>
<!.. css of the class -->
.fix
{
position: fixed;
}
这里是页脚内容和相关的CSS:
<!-- html of the footer -->
<div id="footer">
<section>
<div class="row">
<section class="6u">
<header>
<h2>Social</h2>
</header>
<ul class="footer">
<li><span class="white"><span class="phone"></span></span>li>
</ul>
</section>
</section>
</div>
<!-- css of the footer -->
#footer
{
text-align: center;
}
#footer header h2
{
color: #FFF !important;
}
#footer header .byline
{
color: rgba(255,255,255,.2);
您可以使用该z-index
属性:
.fix {position: fixed;z-index: 1;}
#footer {position: relative;z-index: 9999;background:#ffffff;}
编辑:还为页脚设置背景色,因此它不会透明
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句