Jump to content



Photo

parent Div & Child Div?

div tags div using webdesign

  • Please log in to reply
2 replies to this topic

#1 shakthi

shakthi

    Resident One Post Wonder

  • Joined: 19-July 12

Posted 19 July 2012 - 10:44

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


Edited by Charisma, 20 July 2012 - 18:54.



#2 Kami-

Kami-

    ♫ d(-_-)b ♫

  • Tech Issues Solved: 2
  • Joined: 28-July 08
  • Location: SandBox

Posted 19 July 2012 - 10:51

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

#3 Dorza

Dorza

    Neowinian

  • Joined: 20-February 07
  • Location: South Wales - UK

Posted 19 July 2012 - 10:54

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



Click here to login or here to register to remove this ad, it's free!