Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
The content in one floated div causes the div below it to drop
Old 01-10-2010, 01:24 AM The content in one floated div causes the div below it to drop
Junior Talker

Posts: 1
Trades: 0
Yes, I have cleared all of my divs, too.

I'm displaying WordPress posts horizontally using floated divs. I've got it working fine, but when the divs move to a new row, if the paragraph text inside each floated div is too long, the div immediately below it drops. Furthermore, each floated div is affected by the length of the divs above it.
How do I make them flow naturally without being affected by the heights of those above them?
Here is my HTML for a single floated div:

<div class="entry_column>
<div class="entry">
<h2>Entry title</h2>
<p>Entry excerpt...if this text gets too long, the div immediately
below it gets pushed WAY down</p>
</div>
</div>
<br class="clearFloat" />
And here are the relevant CSS classes:
.entry_column {
float: left; width: 50%;
}

.entry_column .entry {
margin-right: 25px;
}

.clearFloat {
clear: both;
height:0;
font-size: 1px;
line-height: 0px;
}
I tried everything I could think of for the clearing, but if I add clearing directly on the floated divs, I still can't get it to stop dropping.
Hopefully the image explains this issue a bit better. The "This is Just Going To..." box should be directly underneath the "A music post stand" box, and the "More Music" box should be underneath "Another fun post."



Last edited by bumblebee; 01-10-2010 at 01:38 AM..
bumblebee is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-10-2010, 06:57 AM Re: The content in one floated div causes the div below it to drop
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
URI needed, images cannot be "debugged"
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-10-2010, 10:59 AM Re: The content in one floated div causes the div below it to drop
racer x's Avatar
Ultra Talker

Posts: 457
Name: Randy
Location: Northern Wisconsin
Trades: 0
Also would be good to see where your loop starts and stops in your php code. Many times people accidentally put the overall containing div for ALL the posts inside the loop when it should only be the actual div section you want repeated. The way you have the divs, I'd think they'd be clearing.
racer x is offline
Reply With Quote
View Public Profile Visit racer x's homepage!
 
Old 01-11-2010, 07:23 AM Re: The content in one floated div causes the div below it to drop
ArtphotoasiA's Avatar
Extreme Talker

Posts: 245
Location: Italy
Trades: 0
here my 2 cents...

1) be sure to use ""clear:both"" each time you float , usually I create a class clear to be used after each time i float something so I apply the class to some div just to be used as separtor

2) be carefull to the width and remember that container must contain the inside div nicely.


1= float issue 2 = size issue
__________________
" the moment, the unique and unrepeatable second "

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
ArtphotoasiA is offline
Reply With Quote
View Public Profile Visit ArtphotoasiA's homepage!
 
Old 01-11-2010, 04:08 PM Re: The content in one floated div causes the div below it to drop
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Quote:
be sure to use ""clear:both"" each time you float ,
Not necessarily the best method - read our stickies for how to properly clear floats.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to The content in one floated div causes the div below it to drop
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.68434 seconds with 12 queries