内容通过固定的标头传递 [英] Content pass over a fixed header

查看:46
本文介绍了内容通过固定的标头传递的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的html页面中,我用

In my html page, i fixed my header with :

position : fixed

当我向下滚动时,页面的内容就会越过标题.我该如何解决?

When i scroll down, then content of my page pass over the header. How can i fix this?

推荐答案

假设您的HTML如下:

Assuming your HTML is the following:

<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>

这篇关于内容通过固定的标头传递的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆