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
Old 01-20-2009, 08:32 PM DIV and Clear:both;
Truly's Avatar
Ultra Talker

Posts: 322
Trades: 0
Ok so I have been doing some research on the internet over the last couple of weeks after LadynRed and Chrishirst corrected some of my css mistakes. I think I am starting to understand clearing a little bit more but I think I am still waiting for that light to go off in the back of my head.

Does anyone have a favourite tutorial that I read on the net that explains it really well?

Basically from what I have now, you add a dummie <div> that clears a float after the container that was floated. This is done to either force a div to expand so that it encompasses block objects like images or other <div>s or clear to one side if you want to force a new line.

How wrong am I and what am I missing? I feel like I need some <div> theory!
__________________
DVD Movie Release Database:
Please login or register to view this content. Registration is FREE
Truly is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-21-2009, 04:54 AM Re: DIV and Clear:both;
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
That's pretty close. Floats actually exist in a different "plane" in the parent container so only affect the content of the parent NOT the parent itself.
It's one of these odd things to imagine, where a "flat" document is actually a 3 dimensional object, with elements that can be "stacked" and ones that can float to the top of the stack.


http://css.maxdesign.com.au/floatutorial/

or Eric Meyer from Cascading Style Sheets: The Definitive Guide at Google Books
__________________
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-21-2009, 12:05 PM Re: DIV and Clear:both;
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Actually, adding an extra div just to clear a float is not the best semantic method.
Putting overflow:auto on the parent container will clear the floats inside it, as will floating the parent container itself.
__________________
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
 
Old 01-21-2009, 01:24 PM Re: DIV and Clear:both;
Defies a Status

Posts: 1,606
Trades: 0
Quote:
Putting overflow on the parent container will clear the floats inside it, as will floating the parent container itself.

Everytime you post something I learn more. Would you like to come slightly North for a week or so and hang out around here? I will feed you fairly well and pick your brain.


__________________
Colbyt

Please login or register to view this content. Registration is FREE
colbyt is offline
Reply With Quote
View Public Profile
 
Old 01-21-2009, 02:46 PM Re: DIV and Clear:both;
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
lol... I suppose I could spend a weekend in L'ville
__________________
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
 
Old 01-21-2009, 05:08 PM Re: DIV and Clear:both;
Defies a Status

Posts: 1,606
Trades: 0
Where the heck did that car come from in the quote?

Worse that Lville it is Ltown the horse crapital of the world and that spelling was intentional.
__________________
Colbyt

Please login or register to view this content. Registration is FREE
colbyt is offline
Reply With Quote
View Public Profile
 
Old 01-21-2009, 05:24 PM Re: DIV and Clear:both;
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
the car emoticon is : + auto. It's a real pain when posting CSS code.

either put a space in or check the "Disable smilies in text"
__________________
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!
 
Reply     « Reply to DIV and Clear:both;
 

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.52496 seconds with 12 queries