Grow your CSS skills. Land your dream job.

Clear:Both Space problem

  • # July 5, 2009 at 12:56 pm

    So, this has happened to me before on other designs I’ve done, but I’m not sure what causes it or a good way to fix it.

    Basically, if I’m using an inline

    Code:
    clear:both

    like in a <br /> the first line break will jump way down, leaving a huge gap. Any subsequent <br style="clear:both;"> are fine with normal spacing. It’s only the first clear that does it.

    Here’s a screenshot
    And here is a live working example (nevermind the broken images and such – it’s just a staging install)

    Any help or clues are greatly appreciated! Thanks!

    Joel

    # July 5, 2009 at 4:49 pm

    Maybe try using <div class="clear"></div> instead.

    .clear {
    clear: both;
    }

    I know it’s an empty div, but really, who cares.

    # July 6, 2009 at 4:59 am

    Hi @joelgoodman,

    It will not work on that manner using <br /> nor <hr /> tags placing your clear attributes. I’ve already experience that and it didn’t work.

    Instead use an inline;

    <div style="clear:both"></div> or <span style="clear:both"></span>

    or in css just like @TheDoc mentioned above.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".