accelerator — 2012-12-10T13:28:37-05:00 — #1
I'm trying to learn CSS page layout please see:
I have set a 2px border on the #container class, i.e. the main page container div. I was expecting this to produce a border right around the page content, i.e. around the header, down each side and around the footer, but it only goes around the header (I'm looking at the site in Firefox).
Can anyone tell me why the border doesn't go all the way around like I was expecting?
picnictutorials — 2012-12-10T13:50:21-05:00 — #2
Looks like you need to contain your floated stuff. Here is how http://www.visibilityinherit.com/code/contain-floats.php once you do so the border should sorround the outer div
seanuk — 2012-12-10T18:00:54-05:00 — #3
because your container div contains floated items, it doesn't know where the content ends, therefore only shows the container div around the first contained div (header)
a quick and easy fix is to add 'overflow: hidden' to the container div.
accelerator — 2012-12-12T15:24:29-05:00 — #4
Thank you for your help guys.