Sign in to follow this  

parent Div & Child Div?

Recommended Posts

shakthi    0

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
Kami-    178

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
Dorza    10

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;
}
[/CODE]

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  

  • Recently Browsing   0 members

    No registered users viewing this page.