tags:

views:

57

answers:

4

The HTML:

<div id="broadcast">
    <div id="broadcast_header">
        Neighbourhood Broadcast
    </div>
</div>

The CSS:

#broadcast_header
{
 background-color: #A0522D;
 width: 100%;
 height: 20px;
 position: relative;
 top: -20px;
 font-weight: bold;
}

Firefox: All fine, header appears 20px above the div, its cool.
IE: Refuses to show div(broadcast_header)!

Overflow: visible
doctype definition: Given

My input: Suppose change top to - top: -5px; It shows the div(header) partially. Thank you :].

A: 

But here i can see broadcast_header in IE

anish
A: 

Add body { margin:0 } in your CSS.

Steve
A: 

This works differently. The surrounding element (#broadcast) has to have the position: relative; property. Then you can position (#broadcast_header) relative to this one by using position: absolute;

#broadcast_header
{
    background-color: #A0522D;
    width: 100%;
    height: 20px;
    position: absolute;
    top: -20px;
    font-weight: bold;
}

#broadcast
{
     position: relative;
}
Mobbit
Broadcast is already static, which allows its children to be moved about. Also, absolute positioning will negatively (and unnecessarily) affect the flexibility of your layout.
Steve
Exactly Steve, so thats not working Mobbit. Sorry.
Susagittikasusa
And where does the question mention that #broadcast is static?
Mobbit
A: 

I'm not sure what is going wrong with your current code. But here is a jsFiddle sample I made to reproduce the error. But it looks good in both Firefox and IE (8 and 8-compatiblity).

Justus Romijn
#broadcast{ overflow: visible; text-align: left; background-color: white; height: 200px; width: 180px; position: fixed; bottom: 0px; left: 500px; z-index: 12; /* for IE */ filter:alpha(opacity=80); /* CSS3 standard */ opacity:0.8; font-size: small;}This got anything to do with it?
Susagittikasusa
[Updated jsfiddle](http://jsfiddle.net/u7Mjv/3/)I found out that the IE filter setting gave rendering problems. Without it, the relative elements shows correctly above the fixed div.
Justus Romijn