Position: fixed; messes with the head border


#1

Something is happening to the header div.

header{

border: 2px solid #a1ff00;
height: 50px;
width: 100%;
z-index: 1;

Uploading...

Then I add the position: fixed

header{

border: 2px solid #a1ff00;
height: 50px;
width: 100%;
z-index: 1;
position: fixed;

and this happens
Uploading... Uploading...

For some reason the width 100% on the footer stays relative to the size of the browser but the header stretches beyond the browser.

Any ideas?


#2

by default, the body has a margin of 8px. the fixed element ignores this padding on the right side. easiest solution? remove body's margin:

body { margin: 0 }

#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.