Running Through Floats

I had a problem with my <h1> tag running through an object that was floated to the right in the same container and this particular <h1> had a border. No matter what I did to the float, certain objects never physically recognised it and ran through it or dropped down.

The solution I have found for this problem is simply add overflow: auto to the offending tag.

For example: <h1 style=”overflow:auto;”>Header</h1>

Tags: , ,

2 Responses to “Running Through Floats”

  1. homer Says:

    The behavior of your h1 in relation to your floated element is expected since all floated elements will ‘float’ unless you clear them. Also you should have tried float: left to your H1 element to solve that problem.

  2. Rich Powell Says:

    That works too :)

Leave a Reply