Clearfix problem

Discussion in 'HTML' started by luigi7up, Apr 2, 2007.

  1. luigi7up

    luigi7up Guest

    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 */
    luigi7up, Apr 2, 2007
    #1
    1. Advertising

  2. luigi7up

    BootNic Guest

    > luigi7up <> wrote:
    > news:
    > 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*
    BootNic, Apr 2, 2007
    #2
    1. Advertising

  3. luigi7up

    Ben C Guest

    On 2007-04-02, luigi7up <> wrote:
    > 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.
    Ben C, Apr 2, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andreas Suurkuusk
    Replies:
    0
    Views:
    3,947
    Andreas Suurkuusk
    Jul 27, 2003
  2. Ted Miller
    Replies:
    0
    Views:
    5,134
    Ted Miller
    Sep 13, 2003
  3. Merek
    Replies:
    0
    Views:
    1,940
    Merek
    Dec 3, 2003
  4. Scott Meddows
    Replies:
    1
    Views:
    377
    John Saunders
    Jun 8, 2004
  5. Mike

    Problem problem problem :( Need Help

    Mike, May 7, 2004, in forum: ASP General
    Replies:
    2
    Views:
    526
    Bullschmidt
    May 11, 2004
Loading...

Share This Page