Align content to the bottom using Bootstrap 4

Looking for help with aligning content to the middle and bottom on a full-page bootstrap layout? The first page has a background image in the first div, and a darker layer on top in the second div.

<div class="h-100 w-100">
<div class="h-100 w-100 text-center">
    <div class="h-100 w-100 d-flex align-items-center">
        <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12">
            <h1 style="color:#000;">something</h1>  
            <a href="">
            www.something.com
            </a>
            <p class="tto_cl">
            <span style="font-size: 1.8rem;">123</span>
            </p>
            <span style="text-transform:uppercase; color:#000; letter-spacing: 4px; font-family: Arial;">456</span><br>
            </div>
    </div>
</div>

Check out this Jsfiddle link for reference: https://jsfiddle.net/543r2dcs/2/

The content is currently aligned center, but you need it at the bottom instead.

If you're also struggling with understanding the new flexbox system's behavior, you're not alone!

Answer №1

If you're looking for a way to align elements at the bottom, Bootstrap offers a convenient .align-bottom class that can help. Find more information about it here

<span class="align-bottom">bottom</span>

Answer №2

To ensure an element is positioned at the bottom of its parent container, first set the parent element's position to relative. Then, specify the position of the desired element as absolute and set its bottom value to 0 using bottom: 0. This will properly align the element at the bottom. However, be cautious as this may affect the centering of the element. In such cases, you may need to adjust by adding left: 0 and right: 0.

Answer №3

To achieve vertical centering, apply my-auto margin y auto to bring it to the middle position.

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

Incorporating AngularJS to show sections of a webpage in real-time

, I am working on an angular js application in which I'm using rest services to retrieve http response data. My goal is to display different parts of the webpage conditionally based on the response data. For example, if the data in angular indicates " ...

Encountering a MySQL error upon inputting an apostrophe into the form

I'm facing an issue where I can't save a form with an apostrophe to the Database. Here's the code I'm using: <?php $abouttitle=$_POST[abouttitle]; $aboutcontent=$_POST[aboutcontent]; $aboutside=$_POST[aboutside]; $abouts ...

I am curious as to why the Bootstrap 4 dropright selected menu appears as a default browser button in Chrome, while it functions seamlessly in Firefox

An issue has been identified that is specific to Chrome. The dropright selected menu appears differently in Chrome compared to Firefox, where it displays correctly with a white background. !https://i.sstatic.net/BulRA.jpg The Bootstrap version being used ...

What is the best way to incorporate material icons onto a website?

When I attempted to display an icon on my webpage by adding <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> to the index.html file, only the icon name appeared as text instead of the actual ...

What is the procedure for collapsing a table row or grid?

Looking at this image, I'm trying to find a way to collapse the breakfast row. Any ideas on how I can collapse either the entire tr or with a div? ...

disable input box stationary

Is there a way to make a checkbox stay disabled even after refreshing the page? Currently, when I click the checkbox it disables, but upon refreshing the page, it goes back to being enabled. $( "input[type='checkbox']").click(function(event){ ...

Limit the maximum height of a list within a fluid-width content container

I came across this link The layout works fine when the elements are limited in the #commentWrapper, but adding more items pushes everything downwards. Copying additional <li>test</li> items clearly demonstrates the issue. I want the input box ...

Is there a way to properly direct to an internal page while utilizing [routerLink] and setting target="_blank" without triggering a full page reload?

I'm attempting to use [routerLink] along with target="_blank" to direct to an internal page without triggering a full app reload. Currently, the page opens in a new tab, but the whole application is refreshed. Here is the HTML: <a [routerLink]=" ...

The Width of Material UI Divider

Currently seeking a method to increase the line thickness of the Material UI Divider, whether by stretching horizontal lines vertically or stretching vertical lines horizontally. I have reviewed the documentation for Material UI v5 on https://mui.com/mate ...

Arranging images in layers using jQuery or CSS

My current challenge involves two overlapping images. I am looking for a solution where clicking on the back image will bring it forward. I prefer a simple method that is also mobile-friendly since I am using Bootstrap for responsiveness. What suggestions ...

Row buttons in a mat-table that can be clicked individually

In my mat-table, each row represents an audio recording for a call. At the end of each row, there is a play button that plays the respective audio file when clicked. However, whenever I click any play button, the correct audio file plays but all the play b ...

Using jQuery and CSS to Filter and Sort Content

I need help with filtering a list of content based on their class names. The goal is to show specific items when a user clicks on one of two menus. Some items have multiple classes and users should be able to filter by both menus simultaneously. Currently ...

Is it possible to conduct HTML-based Selenium tests without an internet connection?

As a newcomer to Selenium, I am currently using the Selenium IDE which has led me to create table structures like the one below: <table cellspacing="1" cellpadding="1" border="1" name="SELENIUM-TEST"> <thead> <tr class="title"> ...

How to extract JSON data from an HTTP request in Java

I'm seeking to scrape data from a specific link using a Java program. The initial page is not an issue, but when attempting to gather data from subsequent pages, the source code remains the same as on the first page. The vital information I require is ...

Conflict between jQuery and dynamically changing page content

I've come across multiple discussions on SO regarding similar topics, but I haven't been able to successfully troubleshoot my code to achieve the desired functionality. I'm currently working on an application that involves dynamically chang ...

SwipeJS is not compatible with a JQuery-Mobile web application

I am currently attempting to integrate SwipeJS (www.swipejs.com) into my JQuery-Mobile website. <script src="bin/js/swipe.js"></script> <style> /* Swipe 2 required styles */ .swipe { overflow: hidden; ...

My HTML gets rearranged by browsers, causing a change in appearance

UPDATE: I have discovered that the issue lies with Internet Explorer which alters the class attribute of an HTML element from: "<img class="blah".." to "<img class=blah..". This inconsistency only occurs in IE for me. It does not affect other attr ...

Ensure the background image is optimized for viewing on screens of any size

I am facing an issue with an image on my website that serves as the background for some elements. The image is wider than it is tall, causing problems for users viewing the site on phones. Is there a way to cut off the sides of the image and ensure it fits ...

Padding for the doughnut chart in Chart.js canvas

My current setup includes a canvas featuring a doughnut chart created with chart.js enclosed in a div element that displays like this: The canvas has a red background to enhance visibility. Currently, the chart is centered within the canvas with additiona ...

Elements are randomly glitching out with CSS transitions in Firefox

Chrome is working perfectly for me, but when I switch to Firefox it behaves differently than expected I am attempting to create a simple animation (utilizing transitions) that continuously runs on mouseover and smoothly returns to the starting position on ...