0

I know this issue has been tackled before on SO, and I've read alot of the solutions, but for some reason I just can't get this to work right. I've got a container div that I want to split into two sections, side by side. I've got the code distilled down to the bare minimum below (The actual structure is way more complicated than this). If I can get the two interior divs, with red and blue background, to show up side by side I can take it the rest of the way. Theoretically they should expand to fill up the white area inside the containing div at about a 30/70 ratio, but I'm just getting stuck on floating them side by side. If there is an exact answer to my question that I just missed somehow, an internal SO link will be fine.

<div style="margin-left:40px; width:955px; height:300px; background-color:#d6d6d8; border:1px solid #767575;">
    <div style="background-color:#ffffff; margin-top:10px; margin-left:10px; border:1px solid #767575; 

width:932px; height:260px;">
        <div style="float:left; background-color:red; width:100px; height:100px;">
            video holder
        <div>
        <div style="float:left; background-color:blue; width:100px; height:100px;">
            form holder
        </div>
    </div>
</div>
4

1 回答 1

0

您没有关闭红色 div 的标签。您实际上是在打开另一个 div 并将蓝色放入其中。那应该解决它。

<div style="margin-left:40px; width:955px; height:300px; background-color:#d6d6d8; border:1px solid #767575;">
    <div style="background-color:#ffffff; margin-top:10px; margin-left:10px; border:1px solid #767575; width:932px; height:260px;">
        <div style="float:left; background-color:red; width:100px; height:100px;">
            video holder
        </div>
        <div style="float:left; background-color:blue; width:100px; height:100px;">
            form holder
        </div>
    </div>
</div>
于 2013-10-09T15:48:41.947 回答