简体   繁体   English

为什么右侧div与左侧div不并排?

[英]Why right side div is not side by side with the left side div?

I have a page on which I have a lot of divs and something I did (can't figure out what it is) is making the right side div appear below the right side div. 我有一个页面,上面有很多div,而我所做的(无法弄清楚是什么)使右侧div出现在右侧div下方。

Here is an example page: http://www.problemio.com/problems/problem.php?problem_id=223 这是一个示例页面: http : //www.problemio.com/problems/problem.php?problem_id=223

I am staring at this thing with firebug, but can't figure out why this is happening. 我正在用萤火虫盯着这个东西,但不知道为什么会这样。 I even made the width of the left div much narrower, but still the right side div is not lining up next to the left side div. 我什至使左div的宽度更窄,但右侧div仍未排在左侧div旁边。

Any idea what the problem is? 知道是什么问题吗?

Thanks!! 谢谢!!

The <div> with the float:right style is currently inside the <div> with with the float:left style (that may be the change you made). <div>float:right风格是目前里面<div>与该float:left风格(也可能是你所做的更改)。 Just move the <div> you want to float right out of there and make it the immediate sibling of the left floated <div> 只需将要浮动的<div>移到那里,使其立即成为左侧浮动的<div>同级对象。

You HTML is incorrect. 您的HTML不正确。 The right div is inside the left div. 右div在左div内部。 Check your markup. 检查您的标记。

.half_text is 650px, the first div is 120px while the second div is 575px. .half_text为650px,第一个div为120px,第二个div为575px。 Try setting the second's width to 530px. 尝试将秒的宽度设置为530px。 In #suggestions it looks like the right side shouldn't be more than 450px. #suggestions ,看起来右侧不应超过450px。

Hope this helps. 希望这可以帮助。

        ....  
        ....
        </div> <!-- Closes tabs div -->
        </div> <!-- Closes left div -->
         </div>      < ----  Here you need a closing div tag and the right menu goes up.

<div style="float: right; width: 225px;">
....  
........  
 ....

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

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