|
|
#1 |
|
New Member
![]() Join Date: Feb 2010
Posts: 5
|
Hello guys. I have a doubt about some html and css issues. I want to make a div that have no height.that can grow in height along with the divs that are inside this first div. I cant do this because when I put the divs that are inside, to be side by side I had in the CSS "float left" and "clear left". doing this, the main div don't grow with the divs inside. It's hard to explain, so I made a little graphic to explain it.
![]() I hope someone can help me on this. Thanks and Cheers |
|
|
|
|
|
#2 |
|
Super Moderator
![]() Join Date: Oct 2008
Location: Arizona, USA
Posts: 1,053
|
No worries Garret, it makes total sense. Your problem is that floated items dont adhere to the normal flow of a document just like a fixed or absolute positioned element. To remedy this (for floats) you want to set the css style "overflow" to "hidden". You css would look like this:
Code:
div.container {
overflow:hidden;
/* all other styles for the containing div */
}
__________________
John Darling Graphic / Web Designer SmarterTools Inc. (877) 357-6278 www.smartertools.com Last edited by PixelPusher; 02-11-2010 at 03:55 PM. |
|
|
|
|
|
#3 |
|
New Member
![]() Join Date: Feb 2010
Posts: 5
|
thanks for the help. I solved it with adding a div with the clear propriety
|
|
|
|
|
|
#4 |
|
Super Moderator
![]() Join Date: Oct 2008
Location: Arizona, USA
Posts: 1,053
|
Right. The problem there is that you are using an empty element/tag to solve your issue. While this works, it is not semantically correct. The proper solution is to use the overflow style.
__________________
John Darling Graphic / Web Designer SmarterTools Inc. (877) 357-6278 www.smartertools.com |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|