Troubleshooting Flex alignment problem caused by Slick Carousel Slider conflicting with Bootstrap

Today marks the beginning of my question asking journey. After dedicating almost a day to solving this, I humbly seek your assistance! :D

My current challenge involves using Slick's carousel alongside Bootstrap. Whenever I add the 'slick-slider' class where the 'card-group' class is also present, the alignment of buttons doesn't seem to work correctly.

<div class='slick-slider card-group'>

Here's a snippet of the code showcasing the card-group and individual cards:

<section id="slick-slider" class="py-5 med-1">

    <div class='slick-slider card-group'>

      <div class="card border-0" style="width: 18rem;">
        <img class="card-img-top" src="static/img/person1.jpg" alt="Card image cap">
        <div class="card-body d-flex flex-column">
          <h5 class="card-title sm-1">Lorem.</h5>
          <p class="card-text sm-2">Lorem ipsum dolor sit amet.</p>
          <p class="card-text text-primary sm-3">Lorem.</p>
        </div>
        <div class="card-footer d-flex flex-column mt-auto">
          <p class="text-muted small mb-0">Select:</p>
          <div class="clearfix mb-2">
            <button type="button" class="btn btn-outline-danger px-2 py-0 mb-1"><span class="small">4</span><br>$80</button>
              <button type="button" class="btn btn-outline-danger px-2 py-0 mb-1"><span class="small">3</span><br>$50</button>
              <button type="button" class="btn btn-outline-danger px-2 py-0 mb-1"><span class="small">2</span><br>$30</button>
              <button type="button" class="btn btn-outline-danger px-2 py-0 mb-1"><span class="small">1</span><br>$20</button>
          </div>
          <a href="#" class="btn btn-primary">Add to Cart</a>
        </div>
      </div>

      <!-- More card elements similar to above -->

    </div>


</section>

Below are images illustrating the difference with and without the slick-slider class along with card-group.

Intended outcome with Slick: pic link https://i.sstatic.net/JRCaI.png

Unexpected result that needs fixing: pic2 link https://i.sstatic.net/F5z6A.png

Your help is greatly appreciated!

Answer №1

It's important to note that the issue doesn't lie with Slick or Bootstrap. There are two different types of slides in your setup. One type includes three elements: a div with a class of container, a div with a class of card-body, and a div with a class of card-footer. The other type features two divs with a class of card-body and a div with a class of card-footer.

The height of your slides is determined by their content. Because the card-body class contains varying content from slide to slide, the overall slide height fluctuates. To maintain consistent slide height across all slides, you can assign a fixed min-height to the card-body class and the container class. I have implemented these rules in this example.

min-height: 12em;
height: 100%;

Adjust the min-height value based on the maximum height of your slides.

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

HTML5 coding can be enhanced by applying unique CSS rules for alignment purposes

html { font-family: "Open Sans", sans-serif; font-weight: 100; background-color: #fbfbfb; } body { font-family: "Open Sans", sans-serif; font-weight: 100; } body h1 { font-weight: 100; } body h3 { font-family: "Open Sans", sans-serif; fo ...

What key element is not included in this code?

I've been trying to create an interactive green circle that switches between red and green when clicked. Despite checking and rechecking my code, it's still not functioning correctly. I must be making a beginner mistake somewhere. Can anyone poin ...

Canceling a request on timeout using Ajax/jQuery

Beginner - Inquiry - Issue at hand: In scenarios where there are lingering open connections not closed by XMLHttprequest, the goal is to terminate them. Within a javascript file handling Ajax calls, the objective is to initiate a timer for each call and ...

The mobile menu toggle functionality is malfunctioning on actual mobile devices, however, it is operational when tested on various mobile sim

Recently, I noticed that on , the menu collapses into a hamburger icon for mobile. However, when tapping on it on my phone and other devices, nothing happens. Surprisingly, it works perfectly fine when clicking on it in mobile simulators within Google Chro ...

Positioning an Image Within the Center Using Bootstrap

I recently modified some code to create a transparent background for my logo on top of a parallax image. However, after making these changes, I noticed that the logo no longer appears in the center of the screen. Can someone help me identify what could be ...

Insert data into a drop-down menu and organize it

When I choose a value in one Select, the other options are removed and the previous value is added to them. How can I use JQuery to add the previous value to Select and then sort it alphabetically? ...

How can I stack images on top of each other within a div

Currently, I am in the process of creating a blackjack game and encountering an issue with overlapping cards. Despite implementing the code below, all I see is a column of cards displayed. I have looked at similar questions for guidance, but I'm unab ...

Alignment of Bootstrap responsiveness shifted to the left rather than the center

My HTML Code: <div class="gridrow" id="eventsrow"> <div class="gridcard" id="eventcard" style="float:left;width:100%;height:100%;margin-bottom:0.5rem;background-color:white"> <div class="event container"> <div clas ...

Is it feasible to use both position absolute and position sticky at the same time? If so, how can this be accomplished?

Is there a way to keep an element fixed on the display without using position: fixed? I want the element to always remain above other elements, so I used z-index. Additionally, I would like the element to be able to move horizontally without scrolling acro ...

The CSS outline has a soft, rounded appearance rather than a sharp

https://i.sstatic.net/Mkb8Z.png Is there a way to prevent my outline from having rounded corners as it expands during the animation? Note: The issue seems to be present on Linux and MS Edge, but works fine on Mozilla Firefox. Any solutions for MS Edge us ...

How can we separate XML data retrieved from an Ajax call using jQuery?

I have a massive amount of data from an XML file that I am organizing into an unordered list. I need to split the data into multiple lists so that I can style them as columns using CSS. Is there a way to insert a </ul><ul> every 20 entries or s ...

Modifying the default accordion svg icon in Bootstrap 5: A comprehensive guide

Looking to customize the bootstrap icon for accordions Instead of the standard arrow icon, I want to utilize the <i class="bi bi-plus-circle"></i> and <i class="bi bi-dash-circle"></i> bootstrap icons. One icon ...

An effective way to apply Bootstrap styles to projected content within an Angular 7+ application

Although Angular content projection documentation is lacking, I have successfully implemented content projection. However, I am unsure of how to pass Bootstrap classes down to the projected content <ng-content></ng-content> in the child compone ...

Highlight react-bootstrap NavItems with a underline on scroll in React

I am currently working on a website where I have implemented a react-bootstrap navbar with several Nav items. My goal is to enable smooth scrolling through the page, where each section corresponds to an underlined NavItem in the navbar or when clicked, aut ...

Angular JS allows for the display of text from a textarea upon clicking the submit button

Q] How can I display a single text message from a textarea upon clicking the submit button in angular-js? Here is the current code that I have: <html ng-app="myApp"> <head> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1 ...

Tips for creating dynamic horizontal card layouts!

Check out my code here I've been struggling to create responsive horizontal cards that adjust properly on different screen sizes. Despite attempting to change the background image based on viewport size, I have not been successful. HTML <!DOCTYPE ...

Creating a mandatory 'Select' component in Material UI with React JS

Is there a method to show an error message in red until a choice is selected? ...

Unlocking the potential of data inputted in a JQuery Autocomplete form

Seeking assistance with extracting data from a form to utilize for additional purposes <form onsubmit="return false;"> Enter a School: <input id="schoolsearch" type="text" /> <INPUT TYPE=SUBMIT VALUE="GO"> </form> I am struggling ...

sending JSON information to the jQuery post function

Today I'm experimenting with a jQuery code snippet: $.post("test.php", { category: "Ubuntu", newname: "Hash" }, function(data) { alert("Data Loaded: " + data); }); My goal is to include form field data in the json request. In the past, I ha ...

Swapping the icon in the panel heading of Bootstrap 3 Collapse based on its collapse status

Despite many attempts, I haven't been able to make any of the provided answers work in my code. My setup involves using Bootstrap 3 panels and collapse functionality to display advertisements. In the default view, only the advertisement heading is vi ...