implementing footer in the advanced search tab drawer

江枫思渺然 提交于 2019-12-25 03:15:15

问题


I am trying to develop a sticky footer similar to w3schools.

I used the same code in my material UI demo, but it is not working.

I debugged and changed position from fixed to absolute, but it still doesn't work. Can you guys help me? Is it due to material ui or is it due to display block?

When you click the advanced search tab, you can see the red color footer in the drawer. Providing my code snippet and sandbox below:

https://www.w3schools.com/howto/tryit.asp?filename=tryhow_css_fixed_footer

https://codesandbox.io/s/jvmoj49w1y

footer: {
    position: "fixed",
    left: 0,
    bottom: 0,
    width: 100,
    backgroundColor: "red",
    color: "white",
    textAlign: "center"
}

<div className={classes.footer}>
   <p>Footer</p>
</div

回答1:


The element above your footer is causing the screen height to increase. You need to make the position of the footer relative to that element, so it is always below it.

position: "relative",


来源:https://stackoverflow.com/questions/53232921/implementing-footer-in-the-advanced-search-tab-drawer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!