在我的 html 页面中,我用以下内容修复了标题:
position : fixed
当我向下滚动时,页面的内容会越过标题。我怎样才能解决这个问题?
假设您的 HTML 如下:
<div id="header">...</div>
<div id="content">...</div>
尝试以下 CSS:
<style type="text/css">
#header {
position:fixed;
z-index:1;
}
#content {
position:relative;
z-index:2;
}
</style>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)