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

angular bootstrap dropdown opening on the left side

I am facing an issue with the angular bootstrap dropdown. I have successfully implemented it, as shown in this link. However, the problem is that the dropdown opens on the right side by default. Is there a way to make it open on the left side instead? Bel ...

Combining nested lists with the tag-it plugin from jQuery, you can create a list inside a list all

Currently, I am utilizing the Tag-it jQuery plugin found at Tag-it, which functions within a ul element. Within my horizontal list (a ul with multiple li elements), I aim to add another li element containing the Tag-it ul list alongside the main horizonta ...

Is there a way to conceal a div class on the Payment page in Shopify?

I have encountered an issue with the code on the Shopify checkout (Payment) Page. Unfortunately, I am unable to directly edit this page within Shopify, but I have discovered that it is possible to add custom CSS or HTML code within the checkout settings of ...

What is the process for obtaining WOFF files from Google Fonts?

It appears that Google Fonts primarily provides fonts in WOFF2 format. Although this may be compatible with Chrome, WOFF2 is not widely supported by other browsers Is there a method to link directly to Google fonts stored on their CDN using a different f ...

The background image vanishes in Chrome when scrolling downwards

After setting an image with a resolution of 1980 x 1200 as the background for my web page, I encountered an issue. When scrolling down, around the height of 1200px, the image disappears and is replaced by a white background. This problem only occurs in Chr ...

The image in the row wrap container spills over slightly

Even though all the items within that container are wrapped properly as article, there is an issue with the right border of the image overflowing the container's article border. My temporary solution involves adding a mediaquery @1041px and a small a ...

Tips on displaying inline span text within an anchor element, above the anchor text

Check out the code I've created below: .tooltip1 { z-index: 1; position: relative; } .tooltip1 .tooltiptext { visibility: hidden; width: 300px; ...

Automatic Hiding of Dropdown Menu in Twitter Bootstrap: A Quick Guide to Set a 2-Second Timer

Is there a way to make the dropdown menu hide automatically after the mouse cursor leaves the area? If you take a look at Amazon.com for example, when you hover over "Shop by Department" and then quickly move your cursor away and back within about half a ...

Internet Explorer 11 features a fixed "footer" positioned at the bottom of the page. If the content above exceeds the height of the window, the footer will automatically be pushed down to accommodate

I have set up a "footer" to remain at the bottom of the page and adjust its position if the content above extends beyond the window height. While this functions correctly on Chrome, I have encountered an issue with IE11 where the footer does not adjust and ...

Styling the large drop-down menu for Internet Explorer 7

Check out the code snippet at http://jsfiddle.net/jN5G4/1/ Is there a way to align the drop-down menu for "5 Columns" to match the alignment of the other drop-downs? After removing the <a href...> </a> tags from the 5 Columns list item, the d ...

The table's width exceeds the appropriate size

Take a look at the code snippet below <%-- Document : index Created on : Feb 7, 2014, 1:03:15 PM --%> <%@page import="java.util.Map"%> <%@page import="java.util.Iterator"%> <%@page import="analyzer.DataHolder"%> <%@p ...

What is the best way to create a line break in a flex div container to ensure that overflowing items wrap onto the next line using

Using material-ui popper to display a list of avatars. Trying to arrange the avatars horizontally within the popper. <Popper style={{ display: 'flex', maxWidth: '200px', }}> <div style={{ marginRight: '20px' }}&g ...

Variations in the implementation of responsive web design on laptops versus mobile devices

Looking at the css code below: @media only screen and (min-width: 0px) and (max-width: 768px) { ... } I'm curious about why, on my laptop, when I resize the browser window to exactly 768px, the css properties inside this media query are applied. ...

Bootstrap allows for the use of video backgrounds, offering the option for borders to be included

Having trouble with a Bootstrap HTML page featuring a video background? The issue is that sometimes the video has borders on the left and right, and occasionally on mobile devices as well. Oddly enough, when the browser (Chrome or Firefox) is refreshed, th ...

Using Javascript/JQuery to apply pixel values in CSS styling

Recently, I've come across a discrepancy between two different ways of accessing CSS properties in jQuery: <foo>.css('marginTop') (which I always assumed was the standard notation) and <foo>.css('margin-top') (which ...

Image floating gracefully in the top corner of the screen

Check out this Picture I am trying to create a floating image similar to the one in the top left corner of the navigation bar. After searching for some code to achieve this, I came across the following: <html> <head></head> <bod ...

Combining two kebab-case CSS classes within a React component

import React from 'react'; import styles from './stylesheet.moudle.css' <div className={styles['first-style']} {styles['second-style']}> some content </div> What is the correct way to include styles[&ap ...

Ensure that the div is styled with a white background and positioned next to another div with a right margin

I have a white-colored div that needs to be positioned next to another element on a webpage. Additionally, I need a paragraph placed on top of this div for information purposes. Please refer to the following link to see what I am trying to achieve: body ...

Shimmering effect on hover for CSS animation

Is there a way to create a CSS-only animation that fades in and out until hovered when displayed in full? I can achieve both effects separately, but I'm struggling to make them work together. The hover element doesn't seem to be functioning prope ...

"Clicking on the dropdown menu will consistently result in it collapsing

When it comes to a DropDown menu, the typical expectation is that when an option is selected, the menu will collapse. However, in my situation, I do not want the dropdown menu to collapse if the user is attempting to log in and clicks on the Username and P ...