views:

136

answers:

2

I have placed an absolutely positioned element (header) after relatively positioned element (body content). Due to some reason and this works fine in all the browsers except IE8. The header is overlapping the content element with not positioned at its absolute position. The css rules I have used:

#bodyContent{
    clear: both;
    display: table;
    width: 920px;
    margin-top: 173px;
    _margin-top: 178px;
    position: relative;
}
#headerContainer {
    position: absolute;
    top: 0px;
    left:0px;
}

The header part is rendering from the content element postition with space in its position.

Is this the bug in IE8? Can anyone help me sort out this issue?

A: 

This sounds like an old IE7 bug.. can you place an element between them? That fixed it for me.

alex
Could you please tell me what does the 'element between them' mean.
A: 

I've also had similar problems. I used the float command which solved the issue. Try float: left; in #headerContainer

Draco
This hasn't solved for my issue in IE8 Is there any other solution
Try setting the height and width of #headerContainer or maybe even try setting the z-index of #bodyContent to a high value like 99999
Draco
The inner div of headerContainer is using height and width#header{ height: 105px; background-image:url(../../images/elements/centreHeaderBackground.gif); background-repeat:no-repeat; background-position:bottom; display: table; width: 920px;}I have used z-index still the problem exists.Still the header is placed over the same content element
Actually }#bodyContent{ clear: both; display: table; width: 920px; position:absolute; top:173px;}This solves my problem.But the footer is moving to the top of the page and is invisible.Is there any idea why this is happening
Try checking your html syntax. Sometimes browsers, other than IE, seem to ignore a missing tag element and thus renders the page correctly. IE on the other hand does not do this (from my experience that is). Also try setting the inner div in the header container to position: relative
Draco