4 replies [Last post]
danny36
Offline
Regular
Last seen: 14 years 50 weeks ago
Timezone: GMT+1
Joined: 2004-10-01
Posts: 34
Points: 0

This is my 3 columns layout, why the contents of right column push down the contents of center column if I add a div with clear:both after first text block?!

This is an example:

http://www.danny.it/css/

Desdinova
Desdinova's picture
Offline
Enthusiast
Last seen: 10 years 8 weeks ago
Timezone: GMT+1
Joined: 2006-03-28
Posts: 341
Points: 4

well that's pretty logical

well that's pretty logical isn't it? Smile that is what you tell it to do. Clearing elements means no other floats are allowed next to the elements.

As a rule, I never touch anything more sophisticated and delicate than myself

danny36
Offline
Regular
Last seen: 14 years 50 weeks ago
Timezone: GMT+1
Joined: 2004-10-01
Posts: 34
Points: 0

yes it's true but how can I

yes it's true but how can I clear after image?

Desdinova
Desdinova's picture
Offline
Enthusiast
Last seen: 10 years 8 weeks ago
Timezone: GMT+1
Joined: 2006-03-28
Posts: 341
Points: 4

you could set display:

you could set display: block; to the image, if it's not floated it will not allow any elements left or right of it.

As a rule, I never touch anything more sophisticated and delicate than myself

wolfcry911
wolfcry911's picture
Offline
Guru
MA, USA
Last seen: 8 years 48 weeks ago
MA, USA
Timezone: GMT-5
Joined: 2004-09-01
Posts: 3224
Points: 237

you could float the center

you could float the center column, which would allow you to clear floats within it and not be affected by floats outside - but that would limit your liquid design.

another thing you could do is to put the image inside a paragraph (either it's own, or the one it's currently next to) and use overflow: hidden; on that p to contain the float.