i check the code three time for open div’s, the only thing i know that may cause something
like this, and i can’t find the solution why this thing happen.
the footer and the color need to start under the box having the sentence: “where am i”
Floated elements are pretty much taken out of the flow of the document, and non-floated elements that follow them wrap around them, so the footer just wraps around them as such and its background color sits behind them.
Probably a better solution than clear: both on the footer is to set your box-container to overflow: hidden so that is wraps around those floated elements. That stops the issue happening in the first place.
Floating them is fine. There’s no problem with that. It’s just that you need to remember that a container won’t wrap around floated contents by default, so you have to compensate for that. I would certainly use floats there, but I also would always use overflow: hidden on the container (well, almost always).
The other option instead of float is display: inline-block, but I don’t use that as much.