How to stop Sticky Footer from covering content…?

后端 未结 4 1706
一生所求
一生所求 2021-01-31 05:39

I\'m using a \"sticky\" footer, but on a couple of pages it overlays the content. Is there any way to prevent this from happening, but retaining it\'s \"sticky\" quality?

<
4条回答
  •  温柔的废话
    2021-01-31 06:06

    If your body div closed before footer div start then use margin-bottom property. Example if the page structure is

    then write

    #body{
       margin-bottom: (height of your footer);
    }
    

    If your code structure is not like that. I mean your footer div is inside body div. Then use that margin bottom property to the div which close just before footer div start.

提交回复
热议问题