treehouse : what would you like to learn today?
Web Design Web Development iOS Development

[Solved] Div Overlapping Div

  • Hello, everyone.

    I know I'm overlooking something very minor here.

    On this page...
    My Reference Link

    ...I have a div that holds tags, fp_tag_div myclearingdiv

    I can't figure out how to keep that inside of the main div, fp_articles

    specifically, you can see where the tags overlap the main div for the "Exclusive Keldeo GameStop Event" article toward the bottom.

    Any help is much appreciated!
  • By putting a class of 'myclearingdiv' on it, you'll be clearing any floats that occur before your tags, not including your tags.

    You can replace that with 'clearfix' and then add the following to your CSS: http://css-tricks.com/snippets/css/clear-fix/
  • Thanks for the quick reply, Doc.

    I already have a clearfix property in my CSS and it looks like this, which should work.

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

    ...but when I change this:
    <div class="fp_tag_div myclearingdiv">

    to this, in Firebug:
    <div class="fp_tag_div clearfix">

    ...nothing seems to change.
  • Sorry, you'll want to add the clearfix class to . fp_articles
  • Genius!

    Thanks, Doc. I really appreciate the diligence! Love you guys. :)