Step-by-step guide on positioning mid and bottom text using Bootstrap grid system

After searching and trying various solutions, I am still unable to get the desired output. My goal is to use grids in Bootstrap to set the footer layout with the class "link-footer" positioned at the middle height of the div and the class "footer-copyright" at the bottom. Here is an example of what I am aiming for:

Below is the clean code:

<footer class="page-footer">
  <div class="container-fluid text-center">
    <div class="row">
      <div class="col-4 col-footer">
        <h1>aloha name</h1>
      </div>

      <div class="col-2 link-footer">
        <a href="#" class="text-uppercase">home</a>
      </div>
      <div class="col-2 link-footer">
        <a href="#" class="text-uppercase">about me</a>
      </div>
      <div class="col-2 link-footer">
        <a href="#" class="text-uppercase">projects</a>
      </div>
      <div class="col-2 link-footer">
        <a href="#" class="text-uppercase">contact</a>
      </div>

    </div>
  </div>

  <div class="footer-copyright text-center">© 2020 Copyright:
    <span>aloha</span>
  </div>
</footer>

The accompanying CSS is straightforward:

footer {
background-color: #545454;
height: 200px;
}

.col-footer h1 {
text-transform: uppercase;
font-family: 'Montserrat', sans-serif;
font-weight: 800;
font-size:2em;
color:white;
}

.link-footer a {
font-size:1em;
color:white;
font-weight: 600;
text-decoration: none;
}

.link-footer a:hover {
color:#4860FF;
}

.footer-copyright {
background-color: #3b3b3b;
color: #838383;

}

.footer-copyright span{
color: white;
}

I have tried using margins, padding, vertical-align properties, but nothing seems to achieve the desired outcome. Any suggestions? Thank you!

Answer №1

Unfortunately, the screenshot provided does not offer much assistance.

However, another option could be:

<footer class="page-footer">
    <div class="container-fluid text-center py-5" >
        <div class="row">
            <div class="col-4 col-footer">
                <h1>hello name</h1>
            </div>

            <div class="col-2 link-footer">
                <a href="#" class="text-uppercase">home</a>
            </div>
            <div class="col-2 link-footer">
                <a href="#" class="text-uppercase">about us</a>
            </div>
            <div class="col-2 link-footer">
                <a href="#" class="text-uppercase">our work</a>
            </div>
            <div class="col-2 link-footer">
                <a href="#" class="text-uppercase">get in touch</a>
            </div>

        </div>
    </div>

        <div class="footer-copyright text-center" style="margin-top: -15px; padding-bottom: 15px;">© 2021 All Rights Reserved:
            <span>hello</span>
        </div>
</footer>

Don't forget to include the inline CSS in your stylesheet.

Answer №2

footer {
background-color: #545454;
height: 200px;
}

.col-footer h1 {
text-transform: uppercase;
font-family: 'Montserrat', sans-serif;
font-weight: 800;
font-size:2em;
color:white;
}
.link-footer a {
font-size:1em;
color:white;
font-weight: 600;
text-decoration: none;
float:left;
}
.text-uppercase{
padding-right:2em;
}
.link-footer a:hover {
color:#4860FF;
}

.footer-copyright {
background-color: #3b3b3b;
color: #838383;
 position: fixed;
   left: 0;
   bottom: 0;
   width:100%;
   text-align: center;

}

.footer-copyright span{
color: white;
}
<footer class="page-footer">
  <div class="container-fluid text-center">
    <div class="row">
      <div class="col-4 col-footer">
        <h1>hello there</h1>
      </div>

      <div class="col-2 link-footer">
        <a href="#" class="text-uppercase">home</a>
      </div>
      <div class="col-2 link-footer">
        <a href="#" class="text-uppercase">about us</a>
      </div>
      <div class="col-2 link-footer">
        <a href="#" class="text-uppercase">our projects</a>
      </div>
      <div class="col-2 link-footer">
        <a href="#" class="text-uppercase">get in touch</a>
      </div>

    </div>
  </div>

  <div class="footer-copyright text-center">© 2021 All Rights Reserved:
    <span>hello there</span>
  </div>
</footer>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Achieving consistent height for Bootstrap5 columns: A simple guide

I'm currently utilizing Bootstrap5 and I am interested in adjusting the height of these two columns to be similar. Is there a way to achieve this? Below is the code snippet: <link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email ...

Ways to alter the appearance of individual characters in the text input

My latest project involves dynamically changing the CSS styles of each individual character in a given text input. For example, if the user types "Stack" into the input field, I want the 'S' to appear in red, 't' in blue, 'a' ...

What is the best way to align an HTML DIV with a logo on the left side?

I am trying to position a div called #top_menu in the center of the page. <div id="top_menu">This is the menu and it is centered on the page</div> Here is my CSS code: #top_menu { margin: 0 auto; width: 600px; ... } Next to the top menu, I ...

Unusual Behavior Uncovered in jQuery Selectors

Have you ever noticed a peculiar behavior of jQuery selectors? I recently discovered that when the page contains elements with non-unique IDs, jQuery returns different results for the same selectors: Here's an example of HTML code: <button id=&ap ...

Guide on attaching an onclick event to a button created with a string in Next.js?

<div onClick={(event) => this.addToCart(event)}> <ReactMarkdownWithHtml children={this.props.customButton} allowDangerousHtml /> </div> In my current situation, I am facing an issue with the code above. The button is being rendered ...

Struggling to animate the selector of a nested div in Jquery?

Despite trying numerous variations, I am struggling to identify the correct selector of a nested div. The goal is to animate this particular div, but since no animations are taking place, I suspect that I have not selected the right element. Here is the a ...

A CSS rule to display a nested list on the left-hand side

I created a menu that you can view here. When hovering over "tanfa demo example," the sublist appears on the right side. The issue I'm facing is that my menu is positioned all the way to the right, which means the sublist also appears on the extreme ...

Jquery refuses to conceal a particular element

I've encountered this issue before, but I'm facing a problem this time. I'm attempting to create a popup that is initially hidden. When clicked, the popup does appear, but I'm unable to close it. Additionally, when trying to change the ...

Is there a way to create a diagonal movement for an image by clicking on another HTML element?

<!DOCTYPE html> <html> <head> <meta charset="UTF-9"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script> $(function() { $(document).re ...

Display the flowplayer div when the anchor is clicked

I have a dynamic CGI page that displays a list of files. The number of files varies based on uploaded content, so I am looking to create previews for video files. Below is a snippet of HTML code: <TMPL_LOOP files> <tr> <td&g ...

Is there a method available that would allow me to display my HTML code within a frame using Selenium WebDriver and Java?

Currently, I am in the process of automating an Application that includes several embedded iframes. I am wondering if there is a method to view my HTML source code within these frames. ...

Calculator for calculating values using JavaScript data attributes

One issue is that certain elements are canceling each other out.. The value of the element is specified in the "data-price" attribute. My code is currently not valid and does not handle it properly, ideally I would like to update the total whenever a selec ...

Each container has its own div counter

Help needed to complete this code. The task is to count the number of .resp-containers in each container separately. Then, based on that count, assign a corresponding class to each element within the containers. Check out the code here $(document).ready(f ...

What is the best way to add selected values from a multi-select dropdown into an array?

Attempting to populate an array from a multiple select dropdown, I've encountered an issue. Despite using splice to set the order of values being pushed into the array, they end up in a different order based on the selection in the dropdown. For insta ...

Convert the background image (specified in the CSS with background-image) into a PHP variable

I am looking to create a product gallery featuring 5 products, each with its own background image attribute. I am using a loop to insert the product images and I want each loop to display a different background-image. One approach I have considered is usi ...

Is it possible for a website to instruct a user's browser to save the entire page locally?

Is it possible for a (single-page) website to instruct a user's browser to save the entire page locally? To provide some background: I am running a website on a server that bills based on bandwidth usage. Since the content of the site remains mostly ...

Ways to extract information from JSON files

Currently, I am working on a script to extract viewer count and follower count data from Twitch. While I have successfully retrieved the viewer count information, I am encountering issues with extracting the follower count. The essential information can be ...

Loading indicator for buttons

Issue with submit button onclick function (onClick="mandatoryNotes()"). It is taking a while to load, so a preloader script was added. The preloader is now working, but the function is not being called. Seeking assistance. Thank you. function mandatoryN ...

Tips for choosing nested elements with basic CSS selectors like nth-of-type or nth-child for Selenium

Is there a way to select the paragraph tag for B (or C) by utilizing nth-child or nth-of-type in Selenium WebDriver? <tr> <td> <p class="myClass">A</p> </td> </tr> <tr> <td> <p ...

Hover effect for Bootstrap cards

I am working on a view where I display dynamically expanding cards upon hover. Below is the CSS code snippet: .card-deck .card { height:200px; width: 200px; transition: transform .1s; } .card-deck .card:hover { -ms-transform: scale(1. ...