Home › Forums › CSS › Problems with fixed header › Reply To: Problems with fixed header
May 3, 2014 at 8:06 pm
#169170
Participant
When you set the position of an element to fixed
the window (the visible area) essentially becomes its frame. The element is taken out of document flow. Think of it as a soda machine, what happens when you put in $1.35 and press D2, soda pops out and another one slides in its place. Basically same thing happens with the element, so whatever was underneath it now moves up. To get around this you would set the margin on the content that follows your header to the height of the header.
This example might be helpful as well. It shows the difference between fixed
and absolute
position and further explains the idea of a frame.
Hope that helps,
-Alen