views:

97

answers:

3

In FireFox 3.5, the following div does not push the page content down. Rather, it overlaps. IE 8 does not. What can I do as a quick fix?

<div style="position:fixed;top:0;width:100%;">blah blah</div>
A: 

It should overlap, position:fixed does that. Switch it to static or remove position. In both cases top becomes meaningless.

Position fixed: You can set the elements location by setting top right bottom and left. This will contain distance from the browsers border. Position absolute: The same but now top right bottom and left will need the distance from the first parent which has "position: relative".

Fabian
A: 

Should this be "Absolute" rather than "Fixed"

Jaydee
+1  A: 

position: fixed means, that the div should stay absolute to the view point (to the browser window). You can use for real absolute positioning:

position: absolute;
stefita