How to center elements using Bootstrap 4 and flexbox styling

Just starting out in web development.

I currently have the following HTML:

<section class="boxes">
   <div class="container-fluid">
      <div class="row">
         <div class="col-12 col-lg-4 box1">

            <div class="d-flex justify-content-between">
               <div class="boxes-caption-text d-inline-block">
                  Lorem ipsum dolor sit amet enim. Etiam ullamcorper. Suspendisse a pellentesque
               </div>

               <div class="boxes-caption-number d-inline-block text-right">
                  <div class="border-top w-25 d-inline-block pt-2">01</div>
               </div>
            </div>

            <div class="boxes-title text-center pt-6">Szkolenia</div>
            <div class="boxes-arrow"></div>

         </div>

         <div class="col-12 col-lg-4 box2 d-flex h-100">
            xx2
         </div>
         <div class="col-12 col-lg-4 box3">
           xx3
         </div>

      </div>
   </div>
</section> 

And here is my CSS:

.boxes {
  margin-top: 100px;
}

.boxes .box1 {
  background-position: center;
  background-size: cover;
  background-image: url("/img/slide1.jpg");
  color: white;
  height: 872px;
}

.boxes .box2 {
  background-position: center;
  background-size: cover;
  background-image: url("/img/slide2.jpg");
  color: white;
  height: 872px;
}

.boxes .box3 {
  background-position: center;
  background-size: cover;
  background-image: url("/img/slide3.jpg");
  color: white;
  height: 872px;
}

.boxes-caption-text {
  font-size: 16px;
  padding: 50px 0 0 50px;
  width: 40%;
}

.boxes-caption-number {
  font-size: 16px;
  width: 50%;
  padding: 50px 50px 0 0;
}

.boxes-title {
  font-size: 35px;
  vertical-align: 50%;
}

.boxes-arrow {
  display: inline-block;
  margin-top: 1.5rem;
  width: 55px;
  height: 13px;
  background-image: url("/img/white-arrow.png");
}

I am using Bootstrap 4 for this project.

I am aiming to achieve something similar to this example: https://ibb.co/WxHTfbM

This is my current preview (Only first box has been created): https://ibb.co/dfB1G07

I am facing issues with aligning the arrow at the center and placing it at the bottom along with the text "szkolenia" (I need to position it in the center of the div).

Any advice or assistance would be greatly appreciated!

Answer №1

Add this custom style to your stylesheet.

.container-fluid .row .col-12.col-lg-4 {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

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

What is the reason for the absence of absolutely positioned elements in the render tree?

Recently, I came across some information about the render tree: As the DOM tree is being created, the browser simultaneously generates a separate tree known as the render tree. This tree consists of visual elements arranged in the order they will ap ...

Duplicating a Bootstrap theme in Orchard CMS

Currently, I am working on creating my own theme by utilizing the Bootstrap theme from Orchard dashboard as the foundation. However, when I try to launch the site using my theme (without any modifications, simply a clone of Bootstrap), an error appears: "o ...

A guide on adjusting the height of UI elements in Semantic: steps for modifying

One of my current challenges involves using Semantic UI and embedding it within an iFrame tag to display a video. However, I am struggling to adjust the height of the Semantic UI element. <div className="video_box ui embed"> ...

What is the best way to apply CSS to a mat-row element only when it is being hovered over?

I have a table with rows where a specific condition triggers a light red background color for each row. On hover, the background changes to light gray for all rows. However, I need the special rows (already colored light red) to have a deeper shade of red ...

Focused input filter in a tabular header style

I've been working on customizing the Tabulator header filter to have a more "flattened" style, as requested by my boss. In my CSS, I added the code ...input:focus{border:1px solid #1bb394} to change the input border to 1px green. While this change tak ...

Ensuring that the initial column of a table remains in place while scrolling horizontally

Thank you for taking the time to read this. I am currently working on a table within a div container (div0) where the data is dynamically generated, resulting in a table with unpredictable height and width. The outer div allows for both vertical and horizo ...

I'm having trouble getting my jQuery click handler to work

Here is the HTML content within my Sharepoint 2010 Web Part project: <html> <h1>Travel Form Assistance</h1> <div id="preTravel" name="preTravel"> <h2>Pre Travel</h2> <img id="imgPreTravel" name="imgPreTra ...

Attempting to implement image switching with hover effects and clickable regions

Hey there, I'm currently working on a fun little project and could use some guidance on how to achieve a specific effect. The website in question is [redacted], and you can view the code I've used so far at [redacted]. You'll find a code blo ...

"Implementing a full page refresh when interacting with a map using

Here is an example of how I display a map on the entire page: <div id="map_canvas"> </div> UPDATE 2: I have successfully displayed a menu on the map, but there is a problem. When I click on the button, the menu appears briefly and then disapp ...

Utilizing HTML/CSS to display text and an image positioned above a sleek navigation bar

I am struggling to align a logo on the left side of my website, with text on the right next to it, all placed above the navigation bar. Despite my efforts, I just can't seem to get them positioned correctly! CSS .headerLogo{ float:left; marg ...

Using percentages for sizing and margins in CSS

Looking to create a visually appealing page that always fills the entire screen? Check out this code snippet that does just that: #posts{ width:100%; height:auto; background:#666; } .entry{ float:left; margin-left: 4%; margin-top:10 ...

Keeping your Contact Form 7 perfectly centered on your WordPress website

Currently, I am utilizing the contact form 7 plugin on my Wordpress website. While I have two forms set up, I only want to center align one of them. To achieve this, I initially added the following CSS code in my additional CSS: div.wpcf7 { text-align: c ...

Column Alignment Problem in Bootstrap

I'm currently working on a blog template project that resembles the design of this particular page However, I've encountered an issue with aligning the grids in a way that meets my requirements. To showcase my problem, I have shared my version o ...

Button for toggling the mobile navbar in Bootstrap

Is there a way to adjust the position of the navbar-toggle button http://prntscr.com/5sldgb within the navbar after changing its height? Here is the HTML code: <div class="navbar navbar-default"> <div class="container"> ...

Issues with Bootstrap-slider.js functionality

I'm having trouble getting the bootstrap-slider.js library from to function correctly. All I see are textboxes instead of the slider components. You can view an example at I have verified that the CSS and JS files are pointing to the correct direc ...

Responsive Design and the Importance of Setting Min-Width in Bootstrap 3

After doing some research on Stack Overflow about defining a minimum width for a responsive layout in Bootstrap3, I encountered conflicting answers related to "media queries." My goal is to make my layout responsive up to a certain point. Once it reaches, ...

Struggling with transferring information up the React component hierarchy to manipulate the Document Object Model

** I'm still learning React, so any assistance is greatly appreciated! ** A Little Background I have a modal (bootstrap4) hidden within the main app component, containing a form. The form is automatically filled with information from the selected re ...

Using CSS to style PHP function results

I am working on a shopping cart application and I want to incorporate a condensed version of the cart onto my home page. The main shopping cart page is called 'modcart.php' and I have managed to integrate it into my homepage using the following c ...

Guide for implementing smooth fade in and out effect for toggling text with button click

I have this code snippet that toggles text on button click: <!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script> function toggleText(){ ...

Ways to create a fixed top navigation bar that adjusts content similarly to a non-fixed navbar

I'm looking to achieve a fixed navbar at the top that pushes down content when I open the collapse menu, similar to how it functions in static or regular navbars. Something like this example: (https://getbootstrap.com/examples/navbar-static-top/) but ...