Sign in to follow this  
Followers 0

parent Div & Child Div?


3 posts in this topic

Posted (edited)

How can a parent DIV wrap around child DIVs which are floating left or right?

Edited by Charisma

Share this post


Link to post
Share on other sites

Posted

Exactly that, just insert your floated divs inside the parent div... don't forget about 'clear' and jobs done.

Share this post


Link to post
Share on other sites

Posted

Add the following css to your stylesheet


/*CLEAR FIX*

/* For modern browsers */

.clearfix:before,

.clearfix:after {

	content:"";

	display:table;

}

.clearfix:after {

	clear:both;

}

/* For IE 6/7 (trigger hasLayout) */

.clearfix {

	zoom:1;

}

Then add the class "clearfix" to your parent div. Can't remember where I found this so can't give credit but its all over the net in various forms

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.