Bootstrap - Footers Demo
Bootstrap Footer Components
Bootstrap offers pre-built footer components that make it easy to create professional and responsive footers. These footer components are flexible and customizable, allowing you to adapt them to fit the specific needs of your website. By using Bootstrap's footer components, you can save time and effort in creating footers from scratch while still maintaining a consistent and visually appealing design across your site.
Basic Bootstrap Footer
Example: Basic Bootstrap Footer
<footer class="bg-light text-center text-lg-start">
<div class="container p-4">
<div class="row">
<div class="col-lg-6 col-md-12 mb-4 mb-md-0">
<h5 class="text-uppercase">Footer Content</h5>
<p>
Lorem ipsum dolor sit amet consectetur, adipisicing elit. Iste atque ea quis
molestias. Fugiat pariatur maxime quis culpa corporis vitae repudiandae
aliquam voluptatem veniam, est atque cumque eum delectus sint!
</p>
</div>
<div class="col-lg-3 col-md-6 mb-4 mb-md-0">
<h5 class="text-uppercase">Links</h5>
<ul class="list-unstyled mb-0">
<li>
<a href="#!" class="text-dark">Link 1</a>
</li>
<li>
<a href="#!" class="text-dark">Link 2</a>
</li>
<li>
<a href="#!" class="text-dark">Link 3</a>
</li>
<li>
<a href="#!" class="text-dark">Link 4</a>
</li>
</ul>
</div>
<div class="col-lg-3 col-md-6 mb-4 mb-md-0">
<h5 class="text-uppercase mb-0">Links</h5>
<ul class="list-unstyled">
<li>
<a href="#!" class="text-dark">Link 1</a>
</li>
<li>
<a href="#!" class="text-dark">Link 2</a>
</li>
<li>
<a href="#!" class="text-dark">Link 3</a>
</li>
<li>
<a href="#!" class="text-dark">Link 4</a>
</li>
</ul>
</div>
</div>
</div>
<div class="text-center p-3" style="background-color: rgba(0, 0, 0, 0.2);">
© 2023 Copyright:
<a class="text-dark" href="https://mdbootstrap.com/">MDBootstrap.com</a>
</div>
</footer>
Sticky Footer
Bootstrap also provides a sticky footer component that stays fixed to the bottom of the page, even when the content is shorter than the viewport height.
Example: Sticky Footer HTML
<div class="container">
<div class="content">
<!-- Your page content goes here -->
</div>
</div>
<footer class="footer mt-auto py-3 bg-light">
<div class="container">
<span class="text-muted">Place sticky footer content here.</span>
</div>
</footer>
To make the footer sticky, you need to apply the following styles to the <body>
and <html>
elements:
Example: Sticky Footer CSS
html {
position: relative;
min-height: 100%;
}
body {
margin-bottom: 60px; /* Margin bottom by footer height */
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
height: 60px; /* Set the fixed height of the footer here */
line-height: 60px; /* Vertically center the text there */
}
Customizing Bootstrap Footers
You can customize the appearance of Bootstrap footers by modifying the CSS classes applied to the footer elements. Bootstrap provides various utility classes for colors, spacing, and typography that you can use to style your footers according to your design preferences.
Tip: Customizing Footer Appearance
You can change the background color of the footer by replacing the bg-light
class with another background color class like bg-dark
or bg-primary
. Similarly, you can adjust the padding, margins, and text alignment using classes like p-*
, m-*
, text-center
, etc.
You can also add custom CSS to further customize the footer's appearance and layout. By targeting the footer elements using their classes or IDs, you can apply specific styles to achieve the desired look and feel.
Bootstrap Footer Basics
Bootstrap footers are responsive and mobile-friendly, adjusting their layout and appearance to fit different screen sizes. This makes your footer content accessible and readable across devices, from desktops to smartphones.
To create a footer using Bootstrap, you can use Bootstrap classes to style and structure the footer elements. The <footer>
element is the container for the footer content. You can apply classes like bg-*
for background colors, text-*
for text colors, and py-*
or px-*
for padding.
Inside the footer, you can include elements to provide information and navigation links. Common footer elements include:
-
Text: Use
<p>
or<span>
elements to display copyright notices, disclaimers, or other information. Apply Bootstrap's typography classes liketext-muted
orsmall
to style the text. -
Links: Add navigation links using
<a>
elements to help users access pages or resources. You can group links into lists or organize them using Bootstrap's grid system. -
Icons: Use icons to improve the visual appeal and usability of your footer. Bootstrap provides pre-built icons, or you can use third-party icon libraries like Font Awesome.
Example
<footer class="bg-light py-3">
<div class="container">
<div class="row">
<div class="col-md-6">
<p>© 2023 Your Company. All rights reserved.</p>
</div>
<div class="col-md-6 text-end">
<a href="#">Privacy Policy</a>
<a href="#">Terms of Service</a>
<a href="#">Contact Us</a>
</div>
</div>
</div>
</footer>
The footer has a light background color (bg-light
) and padding (py-3
). The content is centered using the container
class, and the row is divided into two columns using the row
and col-md-6
classes. The left column contains the copyright notice, while the right column has navigation links aligned to the right using the text-end
class.
By using Bootstrap's classes and components, you can create professional and responsive footers, providing a consistent and user-friendly experience across your website.
Creating a Simple Bootstrap Footer
To create a simple footer using Bootstrap, start by adding a <footer>
element to your HTML. Inside the <footer>
, you can apply Bootstrap classes to structure and style the content.
Use class="container"
on a <div>
element inside the <footer>
to center the footer content and provide consistent padding. This will help keep the footer content aligned with the rest of your page.
Example: Footer container
<footer>
<div class="container">
<!-- Footer content goes here -->
</div>
</footer>
Next, create rows and columns within the container using class="row"
and class="col-*"
classes. The row
class creates a horizontal group of columns, while the col-*
classes define the width and behavior of each column based on the desired layout.
Example: Footer row and columns
<footer>
<div class="container">
<div class="row">
<div class="col-md-6">
<!-- Left column content -->
</div>
<div class="col-md-6">
<!-- Right column content -->
</div>
</div>
</div>
</footer>
Inside the columns, you can include various types of content, such as copyright information, links, or any other relevant details. Use appropriate HTML elements like <p>
, <ul>
, <a>
, etc., to structure the content semantically.
Example: Footer content
<footer>
<div class="container">
<div class="row">
<div class="col-md-6">
<p>© 2023 Your Company. All rights reserved.</p>
</div>
<div class="col-md-6">
<ul class="list-unstyled">
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
</div>
</div>
</footer>
The list-unstyled
class removes the default bullet points from the unordered list.
You can further customize the appearance of the footer by applying additional Bootstrap classes or custom CSS styles. For example, you can add padding, change background colors, or modify text styles to match your website's design.
Styling Bootstrap Footers
Bootstrap has classes that you can use to style and change your footers. With these classes, you can change the background color, text color and alignment, add padding and margins, and apply typography styles to create nice-looking and well-spaced footers.
To change the footer background color, Bootstrap has background color classes like bg-light
, bg-dark
, bg-primary
, and more. Add the class you want to the <footer>
element or any of its child elements to apply the background color.
Example: Changing Footer Background Color
<footer class="bg-dark text-white">
<div class="container">
<!-- Footer content -->
</div>
</footer>
To change the text color and alignment in the footer, you can use Bootstrap's text utility classes. Classes like text-muted
, text-primary
, text-center
, text-right
, etc., let you change the text color and alignment based on what you need.
Example: Changing Text Color and Alignment
<footer>
<div class="container">
<div class="row">
<div class="col-md-6">
<p class="text-muted">© 2023 Your Company. All rights reserved.</p>
</div>
<div class="col-md-6 text-md-end">
<ul class="list-unstyled">
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
</div>
</div>
</footer>
To create space around footer elements and improve readability, you can add padding and margins using Bootstrap's spacing classes. Classes like p-3
, py-4
, mt-2
, mb-4
, etc., let you control the padding and margins of footer elements.
Example: Adding Padding and Margins
<footer class="py-4">
<div class="container">
<div class="row">
<div class="col-md-6 mb-3">
<h5>About Us</h5>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
</div>
<div class="col-md-6">
<h5>Contact Info</h5>
<ul class="list-unstyled">
<li>Email: info@example.com</li>
<li>Phone: 123-456-7890</li>
</ul>
</div>
</div>
</div>
</footer>
Bootstrap's typography classes can be used to style footer text. Classes like h1
to h6
, lead
, small
, text-uppercase
, etc., help you format headings, paragraphs, and other text elements in the footer.
Example: Styling Footer Typography
<footer>
<div class="container">
<div class="row">
<div class="col-md-6">
<h4 class="text-uppercase mb-3">Company Name</h4>
<p class="lead">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
</div>
<div class="col-md-6">
<h6 class="text-uppercase mb-3">Quick Links</h6>
<ul class="list-unstyled">
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
</div>
<hr>
<p class="text-center small">© 2023 Your Company. All rights reserved.</p>
</div>
</footer>
By combining these Bootstrap classes and changing them based on your design needs, you can create nice-looking and well-styled footers that match your website's overall look.
Bootstrap Footer Examples
Bootstrap provides pre-built footer components that you can use to make different types of footers for your website. Here are some examples of footers that you can create using Bootstrap:
Basic Footer
A basic footer is a simple footer that has a single row and column. It usually includes copyright information and a link to the website's homepage or other important pages.
Example: Basic Footer
<footer class="bg-light py-3">
<div class="container">
<div class="row">
<div class="col text-center">
<p>© 2023 Your Company. All rights reserved.</p>
<a href="#">Back to Top</a>
</div>
</div>
</div>
</footer>
Multi-column Footer
A multi-column footer is divided into multiple columns using Bootstrap's grid system. Each column can contain different types of content, such as links, contact information, or social media icons.
Example: Multi-column Footer
<footer class="bg-dark text-white py-4">
<div class="container">
<div class="row">
<div class="col-md-4">
<h5>About Us</h5>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
</div>
<div class="col-md-4">
<h5>Quick Links</h5>
<ul class="list-unstyled">
<li><a href="#" class="text-white">Home</a></li>
<li><a href="#" class="text-white">About</a></li>
<li><a href="#" class="text-white">Contact</a></li>
</ul>
</div>
<div class="col-md-4">
<h5>Contact Info</h5>
<ul class="list-unstyled">
<li>Email: info@example.com</li>
<li>Phone: 123-456-7890</li>
<li>Address: 123 Street, City, Country</li>
</ul>
</div>
</div>
</div>
</footer>
Minimalist Footer
A minimalist footer has a clean and modern design, containing only the most important information and links.
Example: Minimalist Footer
<footer class="bg-white py-3">
<div class="container">
<div class="row">
<div class="col-md-6">
<p>© 2023 Your Company</p>
</div>
<div class="col-md-6 text-md-end">
<a href="#" class="me-3">Terms of Service</a>
<a href="#">Privacy Policy</a>
</div>
</div>
</div>
</footer>
These are just a few examples of the different types of footers you can create using Bootstrap. By combining Bootstrap's classes and components, you can customize and style your footers to match your website's design and requirements.
Customizing Bootstrap Footers
To customize Bootstrap footers to match your website's design and branding, you can use custom CSS to modify colors, fonts, spacing, and other visual aspects.
To change the footer's colors, target the footer elements using their classes or IDs in your custom CSS file:
Example: Changing footer colors
footer {
background-color: #f8f9fa;
color: #333;
}
footer a {
color: #007bff;
}
footer a:hover {
color: #0056b3;
}
To customize the fonts used in your footer, specify the font family, size, and weight in your CSS:
Example: Customizing footer fonts
footer {
font-family: 'Open Sans', sans-serif;
font-size: 14px;
}
footer h5 {
font-size: 18px;
font-weight: bold;
}
To adjust the spacing between footer elements, use custom padding and margin values:
Example: Adjusting footer spacing
footer {
padding: 40px 0;
}
footer .row {
margin-bottom: 30px;
}
footer .col-md-4 {
padding-right: 30px;
}
To create visually appealing footers, add background images or patterns using the background-image
property in your CSS:
Example: Adding background images
footer {
background-image: url('path/to/your/image.jpg');
background-size: cover;
background-position: center;
}
To add branding elements like logos in your footer, use an <img>
tag and style it with CSS:
Example: Adding a logo to the footer
<footer>
<div class="container">
<div class="row">
<div class="col-md-4">
<img src="path/to/your/logo.png" alt="Your Logo" class="footer-logo">
</div>
<!-- Rest of the footer content -->
</div>
</div>
</footer>
.footer-logo {
max-width: 200px;
height: auto;
}
To adjust the footer layout and responsiveness, use Bootstrap's grid system with responsive column classes (col-sm-*
, col-md-*
, col-lg-*
):
Example: Adjusting footer layout and responsiveness
<footer>
<div class="container">
<div class="row">
<div class="col-md-4 col-sm-6">
<!-- Column content -->
</div>
<div class="col-md-4 col-sm-6">
<!-- Column content -->
</div>
<div class="col-md-4 col-sm-12">
<!-- Column content -->
</div>
</div>
</div>
</footer>
By applying these customization techniques, you can create unique and visually appealing Bootstrap footers that align with your website's design and branding.
Social Media Icons Footer
A footer with social media icons allows users to easily connect with your brand on various social media platforms.
Example: Social Media Icons Footer