开发者

Bug with height attribute of position absolute div in IE6

开发者 https://www.devze.com 2023-01-25 16:30 出处:网络
When I try to run the following <body> <div style=\"width: 400px;height: 1px;background-color: red;position: absolute;bottom: 0;right: 0\"></div>

When I try to run the following

<body>
<div style="width: 400px;height: 1px;background-color: red;position: absolute;bottom: 0;right: 0"></div>
</body>

It d开发者_StackOverflow社区oesn't understand the height of my div in IE6 (also in 5.5).

Is this known bug? And how can I solve it?


It won't create a height/width on it until there's something inside the div. Try adding &nbsp; (or any other text) inside the div to get it to adjust properly.


try font-size:0;line-height:0; as well

0

精彩评论

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