7 replies [Last post]
demiurgen
Offline
Enthusiast
Last seen: 4 years 46 weeks ago
Timezone: GMT+2
Joined: 2005-04-13
Posts: 55
Points: 11

http://www.morganwaage.com/gallery/test.html

on the page above i have a problem.
i have a series of divs inside one main div.
the divs in the main div have float on them and this makes the main div collapse completely...

how can i have a series of divs inside another div like if they were img tags.
using img, the images will come next to each other until there is no more room then start a new line... same when i am using floats only then the background disappears...

any tips??

thepineapplehead
thepineapplehead's picture
Offline
Moderator
Last seen: 4 weeks 6 days ago
Timezone: GMT+1
Joined: 2004-06-30
Posts: 9683
Points: 819

You haven't enclosed your

You haven't enclosed your floats.

Verschwindende wrote:
  • CSS doesn't make pies

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 20 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

clear your float container?

:?

clear your float container?

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

felixters
felixters's picture
Offline
Enthusiast
Last seen: 13 years 48 weeks ago
Timezone: GMT-4
Joined: 2007-04-22
Posts: 55
Points: 0

You need to clear the divs

You need to clear the divs that are floated inside of the main div.

When you float a div, it is no longer part of the flow of the page.

Add the floatcontainer class to your main div.

Include this css code in your stylesheet
.floatcontainer:after{content:".";display:block;height:0px;clear:both;visibility:hidden;font-size:0px}
.floatcontainer{display: inline-block;}
/* Hides from IE Mac \*/
* html .floatcontainer {height:1%}
.floatcontainer{display:block}

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 20 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Study the properties at your

Study the properties at your disposal in CSS it's a vital to know how they behave.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

thepineapplehead
thepineapplehead's picture
Offline
Moderator
Last seen: 4 weeks 6 days ago
Timezone: GMT+1
Joined: 2004-06-30
Posts: 9683
Points: 819

TOO MANY COOKS ZOMG

TOO MANY COOKS ZOMG

Verschwindende wrote:
  • CSS doesn't make pies

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 20 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

I'm a chef, don't ever call

I'm a chef, don't ever call me a cook, You scullery maid you.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

demiurgen
Offline
Enthusiast
Last seen: 4 years 46 weeks ago
Timezone: GMT+2
Joined: 2005-04-13
Posts: 55
Points: 11

that worked!! thanks!!

that worked!!
thanks!!