The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › CSS › How do I remove the margins for the footer?
I have margins which are set at 200px left and right. However, I’d like the colour of my footer to extend through the whole width of the webpage, not just until where the margins are set.
For example, the footer’s background colour is red and currently it stops where the margins are. But I would like this red background to extend beyond these margins. Is this possible?
See the Pen vjKdxL by Anon Student (@cssrookie) on CodePen.
Take the footer out of whatever container it’s in and add an internal dic with those margins to center your content
But if you can’t (or won’t)….you have options
Firstly, it’s odd to use the html element to set margins for the page, but I digress.
You could add negative left and right margins to the footer and then padding to compensate: