Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial


Collapsing margins in Wordpress

I recently converted my website from static HTML to a fully functional WordPress site (God that took forever, but a huge thanks to Mr. Zac Gordon for truly outlining the power and flexibility of WordPress -- I'll probably build all my websites as themes for WordPress);

and I'm having an issue, if you could please take a look at my website

You can see on the homepage, above the footer, there's a dotted grey line dividing the footer sub sections from the main content -- this is great, this is what I want.

But on other pages, like my 'about', 'blog', and 'contact' pages, the border is not there, and the margin between the content and footer look dismal.

I was wondering if anyone could steer me in the right direction with fixing this to maintain consistency across my very first WordPress site.

2 Answers

Adam Moore
Adam Moore
15,825 Points

Make sure that all the inner pages have the same wrapping element as the home or make sure that whatever wrapping element they do have, has a clear-fix of some kind attached.

I'm on my iPhone and not laptop so I can't look at your code at this time but it seems like your collapsing the main container or something...

Thanks for the response! I went through my template files and fixed the margin collapse on all pages except for my blog page, which I've had SOME headway with. I can see the border, however the margin collapsed up into the container, which means the border is up there, the rest of the content isn't disrupted. I'll keep looking around to see if I can't find it.

I suspect it's due to some floated elements on the page, I'm attempting to get a clearfix on them.