Recently I asked a similar question but refering to the nav, and based on that I tried to do the same with the footer, but it seems that I didn’t completely understand how to do it.
What I see is that in order for you to keep the elements centered, you used the line-height property. However, I can’t use it.
The thing is that I can’t change that much the html code.
Based on my previous example, is there a way to do it without changing too much the html structure? Thank you
I realise that you may have only added position:absolute for the demo but generally you would not want to remove the footer from the flow because once you do that you have to control it explicitly all the time and that may be impossible in a fluid page.
You have also set a height on the footer and that is unwise because you don’t really know if that height will be enough to accommodate your content.
In your other thread you set a height on the header and I mentioned previously that it was a bad idea but you seem to be constructing a page that has many elements of fixed heights. I can’t tell if this is your intention but if you are trying to fill the viewport with elements of fixed height then it is unlikely to work out well for you.
In 99.9% of cases you want content to dictate the height of your elements so that you don’t have to micro manage it at every step. If you are looking for a fixed footer then you need position:fixed or if you need a sticky footer then you need this method to accommodate fluid content.
Most of the time though as coothead said “try and keep your code as simple as possible”.