Richie
Richie

Reputation: 41

<div>s not appearing inside one other div when they're suppose too

Basically I have a div, and inside that div is a wrapper and two other divs, one which floats left and one which floats right.

Here is what it looks like: http://puu.sh/Va3J

When you take a look at the code (listed below), you'll notice that .register-form and .login-form are both within #info, but they aren't appearing that way for some reason

Here is the code: http://jsfiddle.net/x8KaA/ (note I only put the code in a jsFiddle because it's a large chunk of code, the result in the result box is not how it actually looks)

Thanks a lot.

Upvotes: 0

Views: 50

Answers (2)

Sune Trudslev
Sune Trudslev

Reputation: 984

This issue is generally known and is fixed crossbrowser with clearfix:

css clearfix

Upvotes: 0

Guffa
Guffa

Reputation: 700800

When you make elements float, they don't affect the size of the parent element. You can use the overflow style to contain the elements, by setting overflow and not specifying height for the element, it will contain its children:

#info { overflow: hidden; }

Upvotes: 2

Related Questions