How can I prevent elements from colliding within a column?

I've been experimenting with the bootstrap grid system and I'm starting to get the hang of it, but I'm facing an issue where changing the width of elements inside a column causes overlap when resizing the browser window.

I'm trying to make my cards responsive when resizing the browser, while also being able to adjust the card sizes without them overlapping.

Here's how it looks when I change the width

And here's how it should look like

This is what my code currently looks like:

<main>
    <div class="container-fluid">
        <div class="row">
            <div class="col-xl-4">
                <div class="card card-cascade dashboard-card bg-lightblue">
                    <div class="data mt-4 ml-3">
                        <div class="button px-2">
                            <a class="btn-floating btn-lg float-right"><i class="fas fa-thumbs-down"></i></a>
                        </div>
                        <h4 class="text-white mb-2">1</h4>
                        <p class="text-white">Test Card</p>
                    </div>
                </div>
            </div>
            <div class="col-xl-4">
                <div class="card card-cascade dashboard-card bg-lightblue">
                    <div class="data mt-4 ml-3">
                        <div class="button px-2">
                            <a class="btn-floating btn-lg float-right"><i class="fas fa-thumbs-up"></i></a>
                        </div>
                        <h4 class="text-white mb-2">0</h4>
                        <p class="text-white">Test Card 2</p>
                    </div>
                </div>
            </div>
            <div class="col-xl-4">
                <div class="card card-cascade dashboard-card bg-lightblue">
                    <div class="data mt-4 ml-3">
                        <div class="button px-2">
                            <a class="btn-floating btn-lg float-right"><i class="fas fa-ticket"></i></a>
                        </div>
                        <h4 class="text-white mb-2">0</h4>
                        <p class="text-white">Test Card 3</p>
                    </div>
                </div>
            </div>
        </div>
    </div>
</main>

I seem to be stuck on this issue. Any help would be greatly appreciated.

Answer №1

Apply col-xl-4 class with these properties:

  1. Set width to (94/3)%
  2. Add 1% padding on the left
  3. Add 1% padding on the right

Next, add container-fluid class with the following styles:

  1. Include 20px of padding on the left
  2. Include 20px of padding on the right

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

"Is it possible to draw on top of a canvas element that's already been

I'm currently working with an OpenLayers map that includes WMS layers with time steps. My goal is to create a loop that updates the time for each step and then saves the image once it's rendered. I've been referencing the example code from t ...

adjusting the font color based on the currently selected tab

After seeking help for my previous question on Unable to add a background colour to the button in navigation I have successfully resolved that issue and continued working, but now I am facing a new challenge. I need to change the font color of the navigat ...

Enhancing a Vue component by including two dynamically computed class properties within a :class="{{}} {{}}" tag

As a newcomer to the Vue world, I have been experimenting with applying 2 computed properties to a :class attribute. Initially, I tried separating each property by a space like this: :class="{{prop1}} {{prop2}}", but upon reload, all content would disappea ...

Launching a Popup in ASP.NET followed by a Redirect

I have a unique custom CSS/HTML popup lightbox along with a form that contains a button. My objective is, upon clicking the button: to open the popup followed by using Thread.Sleep and finally carry out a Response.Redirect to a different page. Do you th ...

Display a dropdown menu depending on the chosen item

In my creation of a simple dropdown list for operators, I have been contemplating whether there is a method to display dropdown items based on the selection made. For example, if I choose "Price" in the Category dropdown which requires an integer value, th ...

Tips for selecting elements within the overflow container that are hidden:scroll

Is it feasible to fetch all elements located within the "hidden area" of a parent element that has an overflow:scroll property? A parent container, <div>, has a style of overflow:scroll;height:200px. Within this container is a table. Take a look at ...

Styling select input forms with Bootstrap 3

I'm looking to create a select dropdown menu that matches the style of other inputs in a bootstrap 3 form. You can view an example of what I want to achieve on this plunker or see the image below: This CSS code is included in the header: <!-- Boo ...

Tips for arranging items to appear in a dropdown menu instead of in a horizontal row on the navigation bar using Bootstrap 4

Sorry if this seems like a basic inquiry, but I'm still learning about bootstrap 4 and haven't had any luck finding the solution online. My issue involves a navigation bar with three columns: logo on the left, small menu in the center, and a log ...

Retrieve Images from URL - Similar to Facebook Thumbnails

I am in the process of creating a website similar to "Reddit." Users will have the option to share URLs, and I would like to use PHP to extract the correct image from these links. What I'm looking for is a more advanced script that can retrieve imag ...

Steps for building an HTML tree

Exploring HTML files can be daunting, especially for someone with limited experience in this field. I am seeking assistance to transform these files into a more readable format, represented as a tree structure with each tag on a separate line. However, des ...

What are the drawbacks of using JavaScript to load a series of images?

Currently, I am facing an issue with the loading speed of a sequence of images on my website. The javascript code I have implemented to cycle through 50 images works perfectly fine locally but becomes slow and buggy when the site is live. Despite the image ...

Tips for displaying user data from a mongodb database on a webpage, making edits to the information, and then saving the updated data

I have a website where users can register, log in, and update their profile information. However, I am facing an issue where only the data of the first user in the database table is being retrieved. How can I get the data of the currently logged-in user? ...

Moving the remaining columns to the following page in PHP: a step-by-step guide

Hello everyone, I've been scouring the internet but have yet to find a solution. I have a code that generates a table. The issue I am facing is that all columns are displayed on one page and I want them to be split into groups of 10 columns per page. ...

How can I prevent duplicate IDs when submitting a form through AJAX within a while loop?

While submitting a form using Ajax within a while loop, I encountered an issue where the same form ID is being used multiple times due to the loop. As a result, the form only submits once. I believe that I need to generate a unique ID for each iteration of ...

The div swiftly clicks and moves beyond the screen with animated motion

Here is a code snippet that I am working with: $(document).ready(function(){ $(".subscriptions").click(function (){ if($(".pollSlider").css("margin-right") == "-200px"){ $('.pollSlider').animate({"margin-right": '+ ...

Can we utilize conditions to both select and deselect items using JavaScript and PHP together?

I have a selection list with checkboxes that is dynamically generated based on certain conditions in the code snippet below. if ($data_inteiro_01 <= $data_inteiro_02) { if ($parcela[$i] === 0) { $display = 'disabled'; } } els ...

When submitting a blank form, radio buttons and check boxes are not included in the query string or post body

Here is the form that I am working with: <form method="post" action="getParameterValuesServlet"> <table border="1"> <tr> <td>User Name</td> <td><input type="text" name="userName"&g ...

What is the best way to position an Angular material button in a specific location on a page?

How can I position the button at the bottom-center of the mat-grid-tile in my HTML file? Here is the code snippet from the .html file: <mat-grid-list cols="1" rowHeight="400"> <mat-grid-tile class="example-grid" &g ...

Ways to automatically divide lists into various div elements

Hey there! I currently have a list of categories on my page that is subject to change. I'm looking for assistance in creating a loop that will divide my lists into groups of 5 items per div. For example: foreach($categories as $cat) <label> ...

What is causing my website to refresh before I can save the edits I have made after clicking on the edit button

My website is fairly simple, allowing users to add blog posts with a title, author, and content. Each post has two buttons - one for deleting and one for editing. These actions add, delete, or edit the chosen posts within a .json file through a local json ...