Clearfix problem

L

luigi7up

I'm working on two coulumns layout. Left div contains menu and basket
while right contains main content...

<body>
<div id="wrap">
<div id=left>
<ul id=menu>
</ul>
</div>
<div id=right>
</div>
</div>
<body>
In right div (content) I have div with image floated to left. Image
float doesn't work well, of course, so I add class clearfix to that
div with floated element. It should be streching vertically just
enough to hold floated image and text within that div but it stretches
too much. I noticed that it spreads vertically to dimensions of
content of left div where my menu is. So, if I add things to my left
column my floated div is spreading more and more...
Funny thing is that if I have two divs in right column second div has
no problems.

Do you have any idea what seems to be the problem?

Netko zna o Äemu je rijeÄ?

/*
******************************
***** 1.2. Clearing floats *****
******************************
*/

..clearfix:after {
content:".";
display:block;
height:0;
clear:both;
visibility:hidden;
}

..clearfix {display:inline-block;}
/* Hide from IE Mac \*/
..clearfix {display:block;}
/* End hide from IE Mac */
 
B

BootNic

luigi7up said:
news: (e-mail address removed)
I'm working on two coulumns layout. Left div contains menu and basket
while right contains main content... [snip]
Do you have any idea what seems to be the problem?
[snip]

You did not provide a url that emulates your issue.

The source you provided did not emulate your issue.

--
BootNic Monday, April 02, 2007 7:29 AM

If you can learn from hard knocks, you can also learn from soft
touches.
*Carolyn Kenmore*
 
B

Ben C

I'm working on two coulumns layout. Left div contains menu and basket
while right contains main content...

<body>
<div id="wrap">
<div id=left>
<ul id=menu>
</ul>
</div>
<div id=right>
</div>
</div>
<body>
In right div (content) I have div with image floated to left. Image
float doesn't work well, of course, so I add class clearfix to that
div with floated element. It should be streching vertically just
enough to hold floated image and text within that div but it stretches
too much. I noticed that it spreads vertically to dimensions of
content of left div where my menu is. So, if I add things to my left
column my floated div is spreading more and more...
Funny thing is that if I have two divs in right column second div has
no problems.

Do you have any idea what seems to be the problem?

It's hard to know for sure without seeing your actual example. Post a
url.

You see, it depends among other things on how you're doing the left and
right divs. It may be that clear is clearing some other floats over on
the left that you don't expect it to clear. clear clears all floats in
its block formatting context, not just in its containing block.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top