CodeSpent
CodeSpent

Reputation: 1904

Section after Header is aligned with Header?

Creating a mockup quick for a WP theme I'm working on a single page for, and I'm not certain what's occurring here. I've seen suggestions when using absolute or fixed positions to set a margin-top equal to the header, but the header is moving WITH the section styling as if its inheriting somewhere.

Inspecting and not seeing the cause. JSFiddle here: https://jsfiddle.net/je53s6hk/

enter image description here

Upvotes: 0

Views: 22

Answers (1)

BeeBee8
BeeBee8

Reputation: 3074

Just add <div class="clearfix"></div> this after end of header tag.

You have used float on header, so you need to clear the float for next elements.

and in your css .clearfix{clear: both;}

Upvotes: 1

Related Questions