Home >Web Front-end >CSS Tutorial >How Can I Make a Footer Stick to the Bottom of the Page in Bootstrap?

How Can I Make a Footer Stick to the Bottom of the Page in Bootstrap?

Linda Hamilton
Linda HamiltonOriginal
2024-12-06 00:59:13970browse

How Can I Make a Footer Stick to the Bottom of the Page in Bootstrap?

Flushing Footer to Bottom of the Page Using Bootstrap

Question:

Having difficulty getting a footer to flush to the bottom of the page using Twitter Bootstrap, especially considering its responsive nature. How can this be achieved effectively?

Answer:

With Bootstrap 2.2.1, this feature is now included.

For Bootstrap 3.x:

Use the navbar component with the ".navbar-fixed-bottom" class:

<div class="navbar navbar-fixed-bottom"></div>

For Bootstrap 4.x:

Incorporate the following code:

<div class="navbar fixed-bottom"></div>

Additionally, ensure that you incorporate the following styling to prevent the page content from being obscured:

body { padding-bottom: 70px; }

Documentation:

For detailed information, consult the official Bootstrap documentation at http://getbootstrap.com/components/#navbar-fixed-bottom.

The above is the detailed content of How Can I Make a Footer Stick to the Bottom of the Page in Bootstrap?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn