I’m actually working on a website that should have a div in position fixed on the top of my page.
But it doesn’t work fine : my div on the top is covering a part of my page. I don’t understand how to get a solution for this.
The div fixed on the top is “.menutop” :
.menutop {
width:100%;
background-color:white;
top:0;
position:fixed;
margin-bottom:10px;
border-bottom:1px solid black;
color: #428CB7;
}
Should I add something in my body configuration ?
Thank you !
When an element has
position:absoluteorposition:fixed, it is removed from the flow, so any other elements will act as if it’s not there. In order to prevent this causing problems, in your case, add amargin-topto your content so that the menu no longer covers it.