Content pass over a fixed header

css, html

Solution

Assuming your HTML is the following:

<div id="header">...</div>
<div id="content">...</div>

Try the following CSS:

<style type="text/css">
  #header {
    position:fixed;
    z-index:1;
  }
  #content {
    position:relative;
    z-index:2;
  }
 </style>

Problem

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?

Original source