Unexpected disturbance in horizontal alignment of bootstrap4 button caused by insertion of additional text above?

I utilized the grid systems layout in bootstrap to present my 3 courses. In this setup, I positioned the course image at the top, the course title in the middle, and the course enroll button at the bottom. However, when inserting a multi-line title for a specific course, the alignment of the "all courses" button is disrupted.

For an example of this layout, you can check out the "HIGHLIGHTED COURSES" section on

Answer №1

To ensure proper alignment of all buttons, include the following CSS properties:

.mb-5 .btn-secondary { bottom: -12%; position: absolute; left: -webkit-calc(50% - 52.5px); left: -moz-calc(50% - 52.5px); left: calc(50% - 52.5px); }
.mb-5, .my-5 { margin-bottom: 7rem!important; }

Explanation:

  1. The button's width is 105px, hence requiring a shift of 52.5px for centering purposes
  2. Adjust the margin-bottom based on specific needs, ensuring headings conform to character limits set by your content team

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

Retrieve information from the selected row within a table by pressing the Enter key

I have a search box that dynamically populates a table. I am using arrow keys to navigate through the rows in the table. When I press the enter key, I want to retrieve the data from the selected row. For example, in the code snippet below, I am trying to ...

What could be causing my HTML elements to shift position based on varying screen sizes or zoom levels?

Does anyone else experience their HTML and CSS elements shifting around based on the screen size or zoom level? I have screenshots illustrating this issue. Here is how it currently appears And here is how it's supposed to look ...

What You Need to Know About Hovering and Highlighting Buttons Using CSS

As a beginner in CSS, I decided to practice padding and margin mechanics by creating two buttons. Now, I'm trying to make the buttons larger without one button pushing the other out of place. I managed to achieve this for the save button, but I'm ...

CSS: Handling Background Images Responsively

I'm experiencing an unusual issue where the image is not appearing, even though the div box shows up when I highlight elements on the page. Validation and inspection also show no issues. Here is the code: <div class="mainImage"></div> A ...

Text randomly appears on the html page

I've been dedicating a significant amount of time to finding a solution, but haven't had any luck. I'm aiming to create a visual effect where 10 words with varying font sizes slide in from different directions on a canvas within my document ...

Tips for positioning label/input box/button on Internet Explorer 7

Here is a Fiddle example you can check out, along with the corresponding code : <div class="menu-alto"> <ul> <li> <a title="Link" href="#">Link</a> </li> <li class="newsletter ...

When collapsing an accordion, Bootstrap radio buttons fail to properly select

I have attempted various methods to achieve the desired functionality of having the accordion content close and open accordingly when checking a radio button, while also having the button visually appear as 'checked'. For a more in-depth example, ...

Can markers be positioned on top of scroll bars?

Looking for a way to display small markers on the scrollbar of an overflow: scroll element, similar to features found in IDEs and text editors like this one: https://github.com/surdu/scroll-marker. I've considered using a pointer-events: none overlay ...

In an environment with Internet Explorer 8, is it possible to use CSS web fonts in the WOFF file format?

Looking to use web fonts on Explorer 8 but having issues with my woff file not being applied as the font for the webpage. Any solutions to this problem? ...

Arrange a bootstrap table according to the specified column index

Typically, bootstrap table sorting is based on the first column. If you want to change this default behavior, you can use data-sort-name="column_name" data-sort-order="asc/desc", as explained in this link. In my case, the columns are d ...

Get rid of Sidebar on Product Category Page | Wordpress Ecommerce Theme

Is there a way to remove the sidebar only for specific Product categories "Slug" without affecting their child slugs? For example, when the URL matches the following - remove the side bar and make the page full width only for the slugs "sanitaryware" and ...

The way Chrome and Firefox interpret zoom varies. What is the best approach to manage this discrepancy in my CSS?

Currently, I am in the process of designing a webpage that features a logo and a menu in the header section. However, I have noticed an issue where, upon zooming in or out, some of the menu items shift to a second row instead of remaining on a single row a ...

jQuery can be used to automatically close a subnav when another subnav is opened

Currently, my code is almost perfect, but there is a slight issue with allowing multiple sub-navs to be open at the same time. I want to ensure that when one sub-nav is opened, any others automatically close. Essentially, in the jQuery code below, I need ...

What's the best way to create a dropdown similar to Github's collaborators menu, but with input text that differs from the dropdown items' text?

In my HTML5 input field, I have a bootstrap dropdown menu that populates the input field with the same text as the selected dropdown item. How can I modify this so that selecting an item updates the input field with different text than what's in the d ...

Tips for changing the width of a child element in CSS without impacting the parent's width

Here is the scenario: <div class="parent"> <div class="sizer" /> <div class="child" /> </div> .sizer { width: 200px; } .child { position: relative; width: 400px; } I am facing restrictions - I cannot explicitly set the width ...

The HTML page failed to load the bootstrap.min.css stylesheet

I am currently working on a project using Java with Spring Boot in IntelliJ IDEA, managed by Maven. However, I am facing an issue when trying to connect bootstrap.min.css on my HTML page. This problem seems to appear randomly without any clear cause. Inte ...

Creating a rotating circle in CSS with ion-slides: A step-by-step guide

Hello, I am attempting to develop a circular object that will rotate in the direction it is dragged. Within this circle, there are elements positioned along the border so that these elements also spin accordingly. To illustrate, below are the specific elem ...

Implementing a delegator with ExtJS 4.1: A step-by-step guide

As a newcomer to javascript, I've recently been tasked with maintaining an application built in Sencha ExtJS 4. One of the components I need to modify is a tooltip feature that displays information when hovering over certain elements. This tooltip app ...

powerful enhancer separates the heading into a layout

I have an HTML div element that just isn't behaving right when I resize the screen. The title pretty much sums it up: <div class='serveMessage'><strong>Fun fact:</strong>&nbsp;over 1,259,468 American students fail ev ...

Issue with data-title attribute in tooltips not functioning properly with Angular 6 and ngx-translate

Currently, I am working on an Angular 6 application that utilizes ngx-translate for localization. Additionally, I have implemented Bootstrap 4 tooltips into the project. However, I am encountering a challenge where I am unable to maintain both localization ...