What is the best way to position this div at the bottom of the page?

Is there a way to move this div to the bottom of the page? https://i.sstatic.net/LR9cNqJd.png

This is the code snippet:

<div class="container-fluid">
<div class="row customRows">
    <div class="col col-md-3">
        <div class="d-flex mb-4">
            <img src="{% static '/img/cat.png' %}" alt="Logo" class="img-fluid w-25 align-self-center">
            <h1 class="heading-4 align-self-center">What are we studying today?</h1>
        </div>
        <ul class="m-0 p-0">
            <a href="#" class="text-decoration-none">
                <p class="parrafo menuItem rounded-2 p-2">
                    Home
                </p>
            </a>
            <a href="#" class="text-decoration-none">
                <p class="parrafo menuItem rounded-2 p-2">
                    Chat
                </p>
            </a>
            <a href="#" class="text-decoration-none">
                <p class="parrafo menuItem rounded-2 p-2">
                    Enter your class
                </p>
            </a>
            <a href="#" class="text-decoration-none">
                <p class="parrafo menuItem rounded-2 p-2">
                    Search classes
                </p>
            </a>
            <a href="#" class="text-decoration-none">
                <p class="parrafo menuItem rounded-2 p-2">
                    Calendar
                </p>
            </a>
        </ul>
        <div class="text-center">
            <img src="{% static '/img/laying.png' %}" alt="" class="w-75">
        </div>
        <div class="profileContainer row p-2 mt-auto">
            <div class="col-2">
                <img src="{% static '/img/girl3.png' %}" class="w-100">
            </div>
            <div class="col-10 my-auto">
                <a href="#" class="text-decoration-none">
                    <p class="parrafo menuItem rounded-2 p-2 m-0">
                        User Name
                    </p>
                </a>
            </div>
        </div>
    </div>
    
    <div class="col col-md-9"></div>
</div>

I have experimented with various methods such as using the 'mt-auto' class from Bootstrap, 'mb-auto' from Bootstrap (to test if the 'ul' element pushed the container to the bottom), setting margin-bottom auto in CSS, and applying 'd-flex' and 'flex-column' with flex-grow (though this caused a change in content distribution).

.menuItem {
  transition: background-color 0.3s ease;
  border-bottom: 1px solid var(--grisClaro2);
 }

 .menuItem:hover {
  background-color: var(--grisClaro2)!important;
 }

.profileContainer {
 border-top: 1px solid var(--grisClaro2);
}

.customRows {
 height: 100vh;
}

Answer №1

I inserted these classes in this section

        <div class="col col-md-3 d-flex flex-column">

and by including mt-auto in the profile container, the div shifted down without affecting the layout https://i.sstatic.net/jtAoVSoF.png

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

Utilizing CSS for displaying and hiding content based on its unique identifier

Is it possible to show/hide a div using only CSS based on its ID? Showcasing this functionality in jQuery or vanilla JavaScript is straightforward, but can the same effect be achieved with pure CSS? The checkbox hack requires a specific structure to func ...

Tips for updating the modal content with a dynamic approach upon clicking an image

On my HTML page, I have 3 thumbnail images. What I want to achieve is that when a user clicks on any of these images, the clicked image should be displayed in a modal window. Is there a way to dynamically pass the image name into the modal-body every time ...

Can't Proceed (POST) I am at a standstill

I've been troubleshooting this issue for hours. I can't seem to pinpoint the cause of the error :( views.py @login_required def create_brand(request): template_name = "poc/brand_add.html" context = {} context["form&quo ...

Investigating Jquery Flip Card Issues

Looking to create a set of flip cards using HTML, CSS, and jQuery. Currently facing an issue where only the first card is flipping when clicked. Any suggestions on how to modify the jQuery code to make it work for all cards would be highly appreciated. C ...

"Upon clicking the facebox, a new page is opened and the

Currently, I'm on a page called mainpage.aspx and the code within it looks like this: <a rel="facebox" href="destination.htm?path=blabla">mainpage</a> I am using facebox() to load destination.htm. The issue arises when I attempt to t ...

Guide on executing a PHP file from HTML or Javascript

I've been searching for a while now without any luck in finding an answer to this seemingly simple question. I don't mind if the page reloads or shows results instantly; all I want is to have a button on my website trigger the execution of a PHP ...

Animating the height of an SVG g element using CSS transitions

I've encountered a challenge: I want to create a blinking eye using SVG. I have created the graphic and converted it into SVG. My plan is to apply a CSS animation to make it blink, but despite spending a lot of time on it, I can't seem to solve t ...

What is the method for altering the background color of an input field upon entering text?

As a beginner in Javascript and jQuery, I am struggling to understand why my code is behaving the way it does. I have written two similar functions aimed at changing the background color of an input field. The objective is to set the background color of t ...

Caution: session_start(): Unable to initialize session cookie - headers have already been sent by (output initiated at

A warning message is displayed on the login page: "It's working in localhost but not in remote host" Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at on line 8) Warning: sess ...

Prevent DIV from being filled by background color

Currently, I am working with a PNG image that has a transparent area resembling a torn checkout receipt with a zig-zag edge. This image is intended to function as the bottom part of a div that has a white background to mimic a till receipt. In my attempt t ...

PHP: Retrieve and store XML data for one-time use within a session

I have implemented Simplexml within a class to load specific nodes from my xml file into html. <?xml version="1.0" encoding="UTF-8"?> <note> <item> <title>Reminder</title> </item> <item> ...

Issue with Resizing: Custom Icons Drifting from Right Side of Header

My header is a bit messy. I wanted it to be based on the full-width image without changing its height. To achieve this, I floated the header image to the left and created a div that filled in the color of the image across the entire page. After that, I add ...

Unable to utilize the type 'SimpleLazyObject' when retrieving context data in a Class Based View

I currently have a Django web application deployed on Heroku. The app is functioning properly, with the exception of one issue that keeps arising. Here are some details: In my local environment, I am using SQLite 3 as the database. In the Heroku environm ...

Crafting a sleek arrow-style stepper with Bootstrap 5 breadcrumbs

I am attempting to create a stepper similar to the one showcased in this instance. To add color to the stepper, I utilized the text-bg-success or text-bg-primary classes on the breadcrumb-item as shown below. However, the spacing between the steps appear ...

Ensure that only the admin is able to make something vanish for everyone else

Is there a way to hide content for everyone except the admin? Currently, I have this code implemented but it only works when a user is not logged in. When another user logs in, the content is still visible. <?php if( isset($_SESSION['username&a ...

What is the best way to ensure uniform lengths for both labels and inputs?

Currently, I am in the process of developing a web app using razor pages. My main focus is on the front end (*.cshtml) where I have integrated 4 objects, each consisting of a label and two inputs. My aim is to have all three components appear in line, with ...

Is it possible to modify the flex direction in Bootstrap based on specific breakpoints?

I am currently utilizing Bootstrap 4 for my project. I have a div that is styled with "d-flex" and it is meant to display as a row at the "lg" breakpoint (screens 1200px and above). However, on smaller devices such as mobile phones at the "sm" or "xs" brea ...

What could be causing the partial transparency in my SVG mask?

I have been working on an interesting SVG code that creates a rectangle with a cutout circle. However, I am facing an issue where the non-cutout part appears to be partially transparent. https://i.sstatic.net/1PLHL.gif Can anyone provide me with guidance ...

Styling buttons with CSS in the Bootstrap framework

I am facing an issue with customizing buttons in Bootstrap. <div class="btn-group"> <button class="btn btn-midd">Link</button> <button class="btn btn-midd dropdown-toggle"> <span class="icon-download-alt icon-gray ...

Loading more pages will be triggered by each click with JQuery's .load() function

Utilizing JQuery has been my go-to solution for various challenges in life, including page loading through the use of the .load() function upon clicking a link with a specific class. Take a look at the following code snippet: $('.pageloader'). ...