position fixed header in html

前端 未结 6 1504
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-01 01:51

I have a header (dynamic height) with a fixed position.

I need to place the container div right below the header. As the header height is dynamic, I can\'t use the

6条回答
  •  南方客
    南方客 (楼主)
    2020-12-01 02:22

    body{
      margin:0;
      padding:0 0 0 0;
    }
    div#header{
      position:absolute;
      top:0;
      left:0;
      width:100%;
      height:25;
    }
    @media screen{
     body>div#header{
       position: fixed;
     }
    }
    * html body{
      overflow:hidden;
    } 
    * html div#content{
      height:100%;
      overflow:auto;
    }
    

提交回复
热议问题