Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

绝对底部 #33

Open
l-hammer opened this issue Mar 12, 2018 · 3 comments
Open

绝对底部 #33

l-hammer opened this issue Mar 12, 2018 · 3 comments

Comments

@l-hammer
Copy link
Owner

https://l-hammer.github.io/You-need-to-know-css/#/sticky-footer

Description

@l-hammer l-hammer changed the title 绝对底部 - Document 绝对底部 Apr 19, 2018
@zjhch123
Copy link

zjhch123 commented May 6, 2018

我觉得这个例子举的不好。
正常的主视区域(main),一般都不会定高吧,我觉得应该是会随着内部元素的变动而高度发生变化的。
所以这类布局我还是喜欢稍微配合一点js实现吧…

@l-hammer
Copy link
Owner Author

l-hammer commented May 6, 2018

@zjhch123
我觉得这个例子举的不好。
正常的主视区域(main),一般都不会定高吧,我觉得应该是会随着内部元素的变动而高度发生变化的。
所以这类布局我还是喜欢稍微配合一点js实现吧…

你可能理解错了,你应该将section当做主视区域,而不是main,后者的定高只是为了示例在文档中的显示效果~

@lcl-101
Copy link

lcl-101 commented Nov 25, 2020

我有个方案,兼容性可以到ie6,我们线上项目都在用

<div class="body_box">
    <div class="main">main</div>
</div>
<div class="footer">footer</div>
.body_box {
    position: relative;
    min-height: 100%;
    width: 100%;
    overflow: hidden;
}
.footer {
    position: relative;
    margin-top: -31px;
    width: 100%;
    text-align: center;
    height: 30px;
    border-top: 1px solid #e5e5e5;
    color: #666;
    z-index: 10;
    overflow: hidden;
}

可以点开这个链接地址看
demo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants