2013-03-08 87 views
0

我有这样的HTML定位在另一个DIV的底部一个div没有规定高度

<div style="position: relative;"> 

<div style="top:0"> 

</div> 

<div style='position: absolute; bottom:0; margin-bottom:0px;'> 


</div> 

</div> 

此代码工作绝对没问题的IE浏览器,但其他浏览器上的两个内部的div是重叠的,我不能给任何指定的高度到外部分区。

回答

0

你并不需要绝对定位:

<div style="position: relative;"> 

    <div style="background:black;"> 
     test 
    </div> 

    <div style='background:red;'> 
     test  
    </div> 

</div> 

见工作fiddle

+0

我在这里用它 http://www.spoiledagent.com/ 的问题是,其他页面的高度是不同的,我想的横幅已经在底部 这样 HTTP对齐://www.spoiledagent.com/about.html – Hanumendra 2013-03-08 10:31:39

+0

在IE和mozilla上打开这些页面你会知道什么是IE浏览器和Mozilla浏览器。正是我想要的 – Hanumendra 2013-03-08 10:38:14

相关问题