简体   繁体   English

Div Alignment FireFox,IE7,IE6

[英]Div Alignment FireFox, IE7, IE6

I am having problems aligning a couple divs in IE6, IE7, IE8 and Firfox 3. They all don't render correct what IE8 and Firefox like the rest don't. 我在对齐IE6,IE7,IE8和Firfox 3中的两个div时遇到问题。它们都无法像其他人一样正确显示IE8和Firefox。

Is it possible to do this via floats and clears.. they dont need to have any spacing between them, I just drew it this way.... Also, the div's should be fixed widths. 是否可以通过浮点数和清除数来做到这一点。.它们之间不需要有任何间距,我只是用这种方式绘制了..而且,div的宽度应该固定。

alt text http://cowfarm.net/divAlign.png 替代文字http://cowfarm.net/divAlign.png

Yeah, this is possible: 是的,这是可能的:

<table>
    <tr>
        <td></td>
        <td rowspan='2'></td>
    </tr>
    <tr>
        <td></td>
    </tr>
    <tr>
        <td colspan='2'></td>
    </tr>
</table>

I'm only kidding, of course. 当然,我只是在开玩笑。

You won't get equal heights for the 2 left DIVs combined and the right DIV. 两个左DIV和右DIV的总高度不会相等。 Unless ofcourse you specify those, or if the contents produce the same heights... But this shouldn't be a problem i think? 当然,除非您指定这些内容,否则如果内容物产生相同的高度...但这不是我认为的问题吗?

Update 更新资料

<style type="text/css">
    #container {float:right;position:relative;}
    #left    {float:left;}
    #left_1  {float:left;}
    #left_2  {clear:left;float:left;}
    #right   {float:right;}
    #bottom  {float:left;clear:both;}
</style>

<div id="container">
    <div id="left">
        <div id="left_1">left 1</div>
        <div id="left_2">left 2</div>
    </div>

    <div id="right">right</div>

    <div id="bottom">bottom</div>
</div>

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

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