Struggling with creating adaptive cards in Bootstrap 4

After building a new website using Bootstrap 4, I encountered an issue with responsiveness. The layout consists of a fluid container with a Grid Row containing 8 columns, each filled with image cards. However, the cards do not display properly on different screen sizes.

Currently, the cards appear as 4 in a row at xl size, but stack vertically at lg and smaller sizes. I have tried adjusting the col classes without success.

If anyone can provide assistance to make the cards responsive, I would like them to display as 4 across at xl, 3 across at lg, and 2 across at md, sm, and xs. Currently, they are only displaying correctly at xl size.

This is my first time seeking help here, and I hope to include some code for reference. Thank you in advance!

Code example:

<div class="container-fluid"> 
    <!--Image Grid-->
    <div class="row"> 
      <!--Real people Reel-->
      <div class="col-xl-3">
        <div class="card col-md-4 col-xl-12"> <img class="card-img-top img-fluid" src="images/university_hospital_network.jpg" alt="Real people Reel"> </div>
        <div class="card-body">
          <h5 class="card-title">Real People Reel</h5>
          <p class="card-text text-open-sans">Your greatest and most credible asset.</p>
          <br>
          <br>
        </div>
      </div>
      <!--End Real People Reel--> 

      <!--University Hospital Newark-->
      <div class="col-xl-3">
        <div class="card col-md-4 col-xl-12"> <img class="card-img-top img-fluid" src="images/surgeons.jpg" alt="Real people Reel"> </div>
        <div class="card-body">
          <h5 class="card-title">University Hospital Newark</h5>
          <p class="text-open-sans">Medical accuracy... expert compliance, clearances and licensing expertise.</p>
          <br>
          <br>
        </div>
      </div>
      <!--End University Hospital Newark--> 

Answer №1

Each "item" in a row should have the responsive class inserted.

<div class="container-fluid"> 
    <!--Image Grid-->
    <div class="row"> 
        <!--Real people Reel-->
        <div class="col-xl-3 col-lg-4 col-md-6 responsive-class"> <!-- add new class here -->
            <div class="card"> <!-- remove class here -->
            <img class="card-img-top img-fluid" src="images/university_hospital_network.jpg" alt="Real people Reel"> </div>
            <div class="card-body">
                <h5 class="card-title">Real People Reel</h5>
                <p class="card-text text-open-sans">Your greatest and most credible asset.</p>
            </div>
        </div>
        <!--End Real People Reel--> 

        <!--University Hospital Newark-->
        <div class="col-xl-3 col-lg-4 col-md-6 responsive-class">
            <div class="card">
                <img class="card-img-top img-fluid" src="images/surgeons.jpg" alt="Real people Reel"> </div>
                <div class="card-body">
                    <h5 class="card-title">University Hospital Newark</h5>
                    <p class="text-open-sans">Medical accuracy... expert compliance, clearances and licensing expertise.</p>
                </div>
            </div>
        </div>
        <!--End University Hospital Newark--> 
    </div>
</div>

For more information on Bootstrap 4 grid system, visit W3Schools

I hope this helps you!

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

Struggling to create a CSS dropdown menu where the dropdown items refuse to align to the left

I am currently working on creating a dropdown menu to reveal hidden elements on mobile devices such as smartphones. However, I am facing an issue where the child elements of the dropdown menu are appearing to the right of the parent element instead of the ...

Transforming the jQuery mobile application navbar into an Android apk menu

Recently, I transformed a jQuery mobile site into an Android app using PhoneGap. However, I've encountered an issue where the navigation bar/menu on Android is truncating the menu words. For example, "What we do" turns into "What we...". Do you have ...

Positioning absolute elements negatively in Firefox may cause unexpected behavior

I attempted to position an absolute element with a negative value, and it works perfectly in every browser except for Firefox. In Chrome, IE, or Safari, the blue handler box is correctly positioned in the middle of the top border. Is there a workaround to ...

Resetting CSS animations using animation-delay

My aim is to animate a series of images on my landing page using Next.js and SCSS. The issue arises when I try to add dynamic animations that reset after each cycle. The delay in the animation causes the reset to also be delayed, which disrupts the flow. I ...

Can we define a style or CSS for one element depending on the characteristics of another element?

One challenge I'm facing involves a 3rd party library (fullcalendar) that automatically sets the height of elements based on internal calculations to ensure they look good in any viewport: <div style="height: 72px;"> Unfortunately, not all ele ...

How can I customize a CSS media class?

In my project, I am using a CSS library that includes the following class: @media only screen and (max-width: 480px) { .nav-tabs>li { margin-bottom:3px; } .nav-tabs>li, .nav-tabs>li>a { display:block !important; ...

Utilizing Apex charts within the Angular 9 framework

I am encountering an issue with utilizing apex charts in angular 9. I can successfully display the chart (line chart) when using mocked data as shown in the first screenshot, but I am facing difficulties when trying to fetch data from a REST API – the ch ...

Issue with enlarging images using UL and LI tags persists

After implementing the code for a simple image enlarge feature (showing a QR code image when the user hovers over the icon), I noticed an issue. Interestingly, the same code is used on two designs, but it's not working on one of them. To view the pr ...

Steps for creating a read-only Material-UI input text field in Angular 12

I'm looking to create a read-only text field using Material-UI that cannot be edited. I attempted to achieve this by disabling it in the .ts file of the component: this.firstFormGroup.controls['gauthan_nirmit'].disable(); However, when I m ...

Interactive YouTube Video Player that keeps video playing in original spot upon clicking the button

Currently, I'm working on a project that involves combining navigation and a video player within the same div container. Here is an image link And another image link The concept is that when you click on one of the four boxes, a new video will appe ...

Finding the best location to place styles that will effectively target all the top email clients

I'm struggling with creating an email template that renders properly across major email clients. I'm unsure of where to place my styles for the template, as I know that emails typically only support tables and require inline styles. However, tec ...

Incorporate SCSS capabilities into a Vue project

The default content of my packages.json file includes the following: "postcss": { "plugins": { "autoprefixer": {} }} Whenever I try to compile using <style lang='scss'>, it doesn't work automatically like it does for Typescript. I ...

Before you can click on it, the dropdown menu mysteriously

After creating a header with a dropdown menu, I am facing an issue where the dropdown disappears before I can click or hover over it. Even after using transitions, the problem persists. What could be causing this? I have limited knowledge in javascript, so ...

Bootstrap 4 has caused a disruption in the virtualized select design

After upgrading from Bootstrap 3 to Bootstrap 4, I noticed that the design of my virtualized select component was completely disrupted. Here is the code snippet: import VirtualizedSelect from 'react-virtualized-select'; import 'react-sele ...

Concerns regarding the efficiency of JavaScript (Odin Project, Etch-a-Sketch) are arising

Currently, I am delving into Javascript on the Odin Project, tackling the Etch-a-Sketch exercise. This involves creating a board where you can draw with your cursor. As part of the exercise, there's a requirement to add a resize button that allows use ...

Motion of the atoms

I recently came across an interesting effect on the IconArchive website, but I am unsure how to implement it. If anyone could help me understand the concept with a small example, that would be greatly appreciated. You can see the effect in action by visi ...

I'm curious, are there any html rendering engines that can display text-based content using curl-php?

When utilizing PHP cURL to interact with webpages, I often find myself needing to use regular expressions if the page contains AJAX and JavaScript elements. Does anyone have any recommendations for rendering HTML pages and extracting the text-based render ...

Tips for resolving table header issues and enabling vertical movement of data while simultaneously allowing both the header and data to move vertically

I need assistance with a challenge I am facing. I have created a table using HTML tags, and now I want to add a vertical scrollbar to the browser without affecting the table's header. The data in the table should move when the vertical scrollbar is us ...

Guide to animating an image along a unique path with JavaScript

I'm trying to animate an arrow along a specific path using CSS translate, but I'm facing a challenge. The arrow should move downwards, then to the left, and finally upwards until it reaches the same horizontal level as its starting point but to ...

Toggling between different divisions independently

I'm trying to create a navigation bar similar to Twitter. I want one specific div within the bar to scroll with notifications or news, while keeping the rest of the bar content unchanged. Any ideas on how to achieve this? Check out my code here. #nav ...