Skip to content

Nested elements not displaying right when floating

March 26, 2014

Okay, so there are some things with web development that really annoy me. One of which is when two nested DIV elements don’t react to one-another. Here is an example: http://www.sitepoint.com/examples/clearing_floats/example1.php just change the Inner DIV to long and you’ll see what I mean.

I found a page that has an explanation of this issue and four ways to solve it. I just used their fourth method which is only a line or two of CSS. All it is, is adding overflow: auto to the outer element. I did, however, need to add height: 100% to the outer element as well. So far it looks like it’s working perfectly.

Read the article here: http://www.sitepoint.com/simple-clearing-of-floats/

Advertisements

From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: