如何实现navbar-static-bottom类?

问题描述 投票:1回答:1

navbar-static-top navbar-fixed-topnavbar-fixed-bottom但是navbar-static-bottom在Bootstrap中不起作用。有没有办法达到这个效果?

html css twitter-bootstrap css3 navbar
1个回答
0
投票

试试这个

HTML

<html>
    <body>
        <div class="wrapper">
            <div class="contents">
                <div class="clearfix">
                    <!-- some contents -->
                </div>
            </div>
            <footer>
                <div class="clearfix">
                    <!-- some contents -->
                </div>
            </footer>
        </div>
    </body>
</html>

CSS

html, body {
    background-color: #F3F3F3;
    height: 100%;
    margin: 0;
    padding: 0;
}

.wrapper {
    position: relative;
    min-height: 100%;
}

.contents {
    height: 1500px;
}

footer {
    background-color: rgb(34, 42, 53);
    position: absolute;
    bottom: 0; /* absolutely bottom */
    width: 100%;
}

.clearfix {
    padding: 20px;
}
© www.soinside.com 2019 - 2024. All rights reserved.