开发者

Div positioning problems in IE

开发者 https://www.devze.com 2023-01-19 22:59 出处:网络
The HTM开发者_开发问答L: <div id=\"broadcast\"> <div id=\"broadcast_header\"> Neighbourhood Broadcast

The HTM开发者_开发问答L:

<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 :].


try top:-10px,it will show in IE and Firefox


You have to set the height and width css for #broadcast

#broadcast
{ 
    height:200px;
    width:200px;
    position:relative
}

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

精彩评论

暂无评论...
验证码 换一张
取 消