简体   繁体   English

IE上的DIV定位问题

[英]DIV positioning problem on IE

i have a problem for my layout... it should be simple but i just won't get it right. 我的版式有问题...应该很简单,但我不会正确。 It works on firefox but not on IE .... :'( 它适用于Firefox,但不适用于IE ....:'(

Problem: the div leftBar and rightBar should be resizing to the content. 问题:div leftBar和rightBar的大小应调整为内容的大小。 If there is a lot of text, they should have the same height (therefor i used top and bottom on an absolute positioning) the content is all right and it works just the leftBar and the rightBar won't resize... thx for responding, regards marius 如果有很多文本,它们应该具有相同的高度(因此我在绝对位置上使用了顶部和底部),内容还可以,并且只适用于leftBar和rightBar不会调整大小... ,问候marius

<div id="container" style="position:relative; width:100px;">
  <div id="leftBar" style="position:absolute; left:0; top:0; bottom:0px; width:10px;"></div>
  <div id="content" style="position:relative; margin-left:10px; margin-right:10px;"></div>
  <div id="rightBar" style="position:absolute; right:0; top:0; bottom:0px; width:10px;"></div>
</div>

尝试将高度设置为auto style="height: auto;"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM