2 replies [Last post]
satrit
Offline
newbie
Last seen: 9 years 9 weeks ago
Joined: 2005-07-18
Posts: 6
Points: 0

I am not understanding what is clear:both;why do we use it?

Tags:
gleddy
gleddy's picture
Offline
Leader
sydney, australia
Last seen: 6 years 19 weeks ago
sydney, australia
Timezone: GMT+10
Joined: 2004-09-21
Posts: 596
Points: 0

clear:both

it is used for floats.

if you float content you can float left or right... so in a common layout you might have a left nav, a content div and a footer.

to ensure the footer stays below both of these floats (if you have floated left and right) then you put the footer as clear: both.

This way it will stay below both floats.

(if you are only clearing left then you only really need to clear: left; )

go through this tutorial:

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

Kamiyasatija
Offline
newbie
Last seen: 5 years 39 weeks ago
Joined: 2008-12-16
Posts: 1
Points: 0

clear:both

Thank you so much.... the given link helped alot.. :thumbsup: