CSS 100 percent height body and element

前端 未结 7 605
野性不改
野性不改 2021-01-02 06:41

I am having an issue making one of my elements 100% within an overall layout that is 100%.

I have tried different positioning solutions and I either end up with hidd

7条回答
  •  清歌不尽
    2021-01-02 07:16

    In your code footer has position:absolute but the actual position (eg. bottom: 30px;) is not given. Also, if you want the .content or .push to affect the .footer position, they would have to be in the same flow (eg. both position:static;). Giving footer position:absolute by definition takes the footer positioning from the normal flow, so this is incompatible with the objective.

    I assume what you're trying to do is get a page that is 100% even with little content, and a footer that's always on the bottom of the page/screen.

    FooterStickAlt is a good cross-browser solution to achieve that. http://www.themaninblue.com/experiment/footerStickAlt/

提交回复
热议问题