Web Design Forum  
 
Go Back   Web Design Forum > Web and Graphic Design > Web Design

Reply
 
LinkBack Thread Tools Display Modes
Old 02-10-2010, 10:07 PM   #1
New Member
 
Join Date: Feb 2010
Posts: 5
Default Html & css

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
garretblake is offline   Reply With Quote


Old 02-11-2010, 05:59 AM   #2
Super Moderator
 
Join Date: Oct 2008
Location: Arizona, USA
Posts: 1,053
Default

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.
PixelPusher is offline   Reply With Quote
Old 02-11-2010, 09:51 AM   #3
New Member
 
Join Date: Feb 2010
Posts: 5
Default

thanks for the help. I solved it with adding a div with the clear propriety
garretblake is offline   Reply With Quote
Old 02-11-2010, 03:57 PM   #4
Super Moderator
 
Join Date: Oct 2008
Location: Arizona, USA
Posts: 1,053
Default

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
PixelPusher is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 03:57 PM.


Camera Forum - Computer Forum - Web Design Forum

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO 3.6.0 ©2011, Crawlability, Inc.