css - Margin of header is added to body (how to solve it ?) -


i try solve problem hours ... tried few tricks, small hack, tried add positions "relative, absolute...etc", "top", top add invisible not fixed div behind fixed , others, want cleanest solution possible , know why have got problem.

: have menu "fixed" top, , header. header behind menu (normal), the problem when add margin header, adds margin body, while want add margin header inside body, place header under menu without position:relative+top:xpx. , use "box-sizing: border-box" doesn't change anything

http://jsfiddle.net/wdnz4/

<div id="menu"> </div>  <div id="header">     test1(success)<br>test2<br>test3(lose)<br>test4<br>test5 </div> 

(can't post css, little bug, go jsfiddle)

thanx in advance !

add top:0; property #menu:

#menu {     height: 40px;     width: 100%;     position: fixed;     background-color: red;     top:0;  } 

jsfiddle: http://jsfiddle.net/wdnz4/4/


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -