Giter Site home page Giter Site logo

绝对底部 about you-need-to-know-css HOT 3 OPEN

l-hammer avatar l-hammer commented on July 29, 2024
绝对底部

from you-need-to-know-css.

Comments (3)

zjhch123 avatar zjhch123 commented on July 29, 2024

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

from you-need-to-know-css.

l-hammer avatar l-hammer commented on July 29, 2024

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

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

from you-need-to-know-css.

lcl-101 avatar lcl-101 commented on July 29, 2024

我有个方案,兼容性可以到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

from you-need-to-know-css.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.