What are the steps to address a bug in Bootstrap carousel?

The final element of the slider isn't displaying correctly and causing issues with the entire carousel. Strangely, if I remove the third item from the carousel, it looks good even though the last item is missing. How can this bug be resolved? Bootstrap, jQuery, and font-awesome are all properly linked.

<div id="carouselServices" class="carousel slide" data-ride="carousel">
                        <div class="carousel-inner">
                            <div class="carousel-item active">
                                <div class="row">
                                    <div class="col-md px-md-5">
                                        <div class="text-dark pb-3">
                                            <i class="fa fa-shield fa-5x"></i>
                                        </div>
                                        <h4 class="text-dark">WPWL MULTI-LANGUAGE SUPPORT</h4>
                                        <br>
                                        <p class="text-secondary">Lorem ipsum dolor sit amet consectetur adipisicing elit. Porro quam iure suscipit minus, ab, distinctio ex voluptatibus, dolorum quisquam incidunt dolores. Atque, eos sit. Fuga, reiciendis? Maiores rerum deleniti illo!</p>
                                    </div>
                                    <div class="col-md px-md-5">
                                        <div class="text-dark pb-3">
                                            <i class="fa fa-cog fa-5x"></i>
                                        </div>
                                        <h4 class="text-dark">FULLY CUSTOMIZABLE THEME</h4>
                                        <br>
                                        <p class="text-secondary">Lorem ipsum dolor sit amet consectetur adipisicing elit. Porro quam iure suscipit minus, ab, distinctio ex voluptatibus, dolorum quisquam incidunt dolores. Atque, eos sit. Fuga, reiciendis? Maiores rerum deleniti illo!</p>
                                    </div>
                                    <div class="col-md px-md-5">
                                        <div class="text-dark pb-3">
                                            <i class="fa fa-bolt fa-5x"></i>
                                        </div>
                                        <h4 class="text-dark">STUNNING UPDATE VERSION 7.0</h4>
                                        <br>
                                        <p class="text-secondary">Lorem ipsum dolor sit amet consectetur adipisicing elit. Porro quam iure suscipit minus, ab, distinctio ex voluptatibus, dolorum quisquam incidunt dolores. Atque, eos sit. Fuga, reiciendis? Maiores rerum deleniti illo!</p>
                                    </div>
                                </div>
                            </div>
                            <div class="carousel-item">
                                <div class="row">
                                    <div class="col-md px-md-5">
                                        <div class="text-dark pb-3">
                                            <i class="fa fa-shield fa-5x"></i>
                                        </div>
                                        <h4 class="text-dark">WPWL MULTI-LANGUAGE SUPPORT</h4>
                                        <br>
                                        <p class="text-secondary">Lorem ipsum dolor sit amet consectetur adipisicing elit. Porro quam iure suscipit minus, ab, distinctio ex voluptatibus, dolorum quisquam incidunt dolores. Atque, eos sit. Fuga, reiciendis? Maiores rerum deleniti illo!</p>
                                    </div>
                                    <div class="col-md px-md-5">
                                        <div class="text-dark pb-3">
                                            <i class="fa fa-cog fa-5x"></i>
                                        </div>
                                        <h4 class="text-dark">FULLY CUSTOMIZABLE THEME</h4>
                                        <br>
                                        <p class="text-secondary">Lorem ipsum dolor sit amet consectetur adipisicing elit. Porro quam iure suscipit minus, ab, distinctio ex voluptatibus, dolorum quisquam incidunt dolores. Atque, eos sit. Fuga, reiciendis? Maiores rerum deleniti illo!</p>
                                    </div>
                                    <div class="col-md px-md-5">
                                        <div class="text-dark pb-3">
                                            <i class="fa fa-bolt fa-5x"></i>
                                        </div>
                                        <h4 class="text-dark">STUNNING UPDATE VERSION 7.0</h4>
                                        <br>
                                        <p class="text-secondary">Lorem ipsum dolor sit amet consectetur adipisicing elit. Porro quam iure suscipit minus, ab, distinctio ex voluptatibus, dolorum quisquam incidunt dolores. Atque, eos sit. Fuga, reiciendis? Maiores rerum deleniti illo!</p>
                                    </div>
                            </div>

                        </div>
                    </div>
                    <ol class="carousel-indicators">
                        <li data-target="#carouselServices" data-slide-to="0" class="active"></li>
                        <li data-target="#carouselServices" data-slide-to="1"></li>
                        <li data-target="#carouselServices" data-slide-to="2"></li>
                    </ol>
                    <a href="#carouselServices" class="carousel-control-prev" role="button" data-slide="prev">
                        <span class="carousel-control-prev-icon" aria-hidden="true"></span>
                        <span class="sr-only">Previous</span>
                    </a>
                    <a href="#carouselServices" class="carousel-control-next" role="button" data-slide="next">
                        <span class="carousel-control-next-icon"></span>
                        <span class="sr-only">Next</span>
                    </a>

Answer №1

To start with, reposition your carousel-indicators, carousel-control-prev, and carousel-control-next elements outside the carousel-inner div element. Additionally, ensure that all your carousel-item divs are properly closed. I have made some adjustments to the code, so please verify if it now functions correctly.

<div id="carouselServices" class="carousel slide" data-ride="carousel">

    <ol class="carousel-indicators">
        <li data-target="#carouselServices" data-slide-to="0" class="active"></li>
        <li data-target="#carouselServices" data-slide-to="1"></li>
        <li data-target="#carouselServices" data-slide-to="2"></li>
    </ol>
    
    <div class="carousel-inner">
        <div class="carousel-item active">
            <div class="row">
                <div class="col-md px-md-5">
                    <div class="text-dark pb-3">
                        <i class="fa fa-shield fa-5x"></i>
                    </div>
                    <h4 class="text-dark">WPWL MULTI-LANGUAGE SUPPORT</h4>
                    <br>
                    <p class="text-secondary">Lorem ipsum dolor sit amet consectetur adipisicing elit. Porro quam iure suscipit minus, ab, distinctio ex voluptatibus, dolorum quisquam incidunt dolores. Atque, eos sit. Fuga, reiciendis? Maiores rerum deleniti illo!</p>
                </div>
                
                <div class="col-md px-md-5">
                    <div class="text-dark pb-3">
                        <i class="fa fa-cog fa-5x"></i>
                    </div>
                    <h4 class="text-dark">FULLY CUSTOMIZABLE THEME</h4>
                    <br>
                    <p class="text-secondary">Lorem ipsum dolor sit amet consectetur adipisicing elit. Porro quam iure suscipit minus, ab, distinctio ex voluptatibus, dolorum quisquam incidunt dolores. Atque, eos sit. Fuga, reiciendis? Maiores rerum deleniti illo!</p>
                </div>
                
                <div class="col-md px-md-5">
                    <div class="text-dark pb-3">
                        <i class="fa fa-bolt fa-5x"></i>
                    </div>
                    <h4 class="text-dark">STUNNING UPDATE VERSION 7.0</h4>
                    <br>
                    <p class="text-secondary">Lorem ipsum dolor sit amet consectetur adipisicing elit. Porro quam iure suscipit minus, ab, distinctio ex voluptatibus, dolorum quisquam incidunt dolores. Atque, eos sit. Fuga, reiciendis? Maiores rerum deleniti illo!</p>
                </div>
            </div>
        </div>
        
        <div class="carousel-item">
            ...
            // Additional carousel items go here
        </div>
        
    </div><!-- ./carousel-inner -->

    <a href="#carouselServices" class="carousel-control-prev" role="button" data-slide="prev">
        ...
        // Carousel control previous button details
    </a>
    
    <a href="#carouselServices" class="carousel-control-next" role="button" data-slide="next">
        ...
        // Carousel control next button details
    </a>
</div><!-- ./carousel -->

I trust this resolves the issues you were facing.

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

In certain cases, Bootstrap Grid may initiate a new row from the right side

Occasionally, when the last grid height differs from the others, a new grid will start from the right side in the next row. This is illustrated clearly in the image below. https://i.sstatic.net/Kjj25.jpg I have implemented <div class="col-xs-6 col-sm- ...

What is the best way to left-align numbers in a table?

https://jsfiddle.net/6a7d2snj/ I need help aligning numbers to the left within a table column: 50 5 -40 -4 How can I achieve this? Using style="align:right" aligns the numbers on the right, but my goal is to have them aligned to the left! ...

CSS parsing through regular expressions

I trust this message finds you in good health. I understand that a one-size-fits-all regular expression for CSS may not work in every scenario. However, I am currently analyzing a specific CSS segment and can customize the expression to meet my requiremen ...

What is the best way to ensure that the Bootstrap navbar remains collapsed at all times, regardless of the size of the

Is there a way to keep my Bootstrap navbar constantly collapsed regardless of the screen size? I'm currently using Bootstrap, and I've noticed that when the screen is larger, the navbar expands automatically. What can I do to ensure that the navb ...

How can I make the Bootstrap 4 checkbox/switch control smaller using the -sm class?

When using BS4, it is possible to add a custom switch/checkbox to a form. However, the small (-sm) modification does not seem to work. I have included a code sample and an image for reference. https://i.sstatic.net/8bhKz.png My goal is to make the switch ...

Enhancing user experience with a jQuery autocomplete feature for dual language support

There are two input fields, one for English and the other for Spanish. {!! Form::text('titulo_en', null, array('placeholder' => 'Title','class' => 'form-control buscador')) !!} {!! Form::text('t ...

Consistently receiving error messages with every Ajax request

I am experiencing difficulties when trying to call a WebMethod using Jquery. function runQuery(e) { var search = $(e).val(); var csKind; if ($('#rbLP').is(':checked')) csKind = 1; else csKind = 0; var params = { ...

Reproducing contents from an HTML div

I am facing a challenge with two <div> elements that share the same structure, but differ in their id and name. My goal is to transfer the values from one div to the other while preserving attributes and copying only the value attributes. This was m ...

Having trouble with WebRTC video streaming on Firefox?

I have implemented one-way broadcasting in my Dot Net MVC website for video streaming using the example found at https://github.com/muaz-khan/WebRTC-Experiment/blob/master/webrtc-broadcasting/index.html. While it works perfectly in Google Chrome, unfortuna ...

Can the load() function retrieve an element along with its descendants?

While experimenting with the jQuery load() command, I encountered an interesting scenario. My code looked something like this: $('<div id="box" />').load('my.html div#content', function(){ etc. To my surprise, I was able to retri ...

Ways to switch the state of one element while causing other elements to respond

Here is the code snippet I am working with: function myFunction(x) { x.classList.toggle('change'); } body, hmtl { background- color: black; } .text { color: Black; } a { text-decoration: none; } .container { display: inline-block; ...

Using jQuery-Ajax to fetch MySQL data in Perl

Currently, I am in the process of developing a webpage that consists of three essential components: a select box, a button, and a table. At a high level, the user makes a selection from the element and then clicks the button. Subsequently, a PERL script is ...

Submit a document through a jQuery post method in conjunction with PHP

Is there a way to upload a file without using a form and instead utilizing $.post method to transfer the file? I suspect that the issue lies within the PHP code, although I can't be certain. <input type='file' id='inpfile'> ...

"Transfer" the code within a Message Sending template

Although I am not well-versed in coding like many of you, I have been able to customize a free template to suit my needs. However, I am struggling with one aspect. When users submit their information on the contact form, I want their message and details to ...

Steps to modify the look of text upon button click using jQuery and utilizing the information from a table row

Currently, I am working on a jquery code. My issue revolves around utilizing strike-through in a row that contains "101", with each number being stored in a table. For example: 1 0 1 1 1 0 1 All this data is within a table structure. My goal now i ...

The margin-right and margin-left properties function differently when it comes to dealing with overflow of floated divs

<body> <div class="content"> <div class="content-sidebar"> content-sidebar </div> <div class="content-main"> content-main </div> ...

Click to Rotate Angular Chevron

Is it possible to animate the rotation of a chevron icon from left-facing to right-facing using Angular? CSS: .rotate-chevron { transition: .1s linear; } HTML: <button [class.button-open]="!slideOpen" [class.button-close]="slideOpe ...

Switching background images dynamically depending on the screen size: CSS and HTML5 Gallery

Here's the issue: the HTML5 page is responsive, but the background images are not changing with the screen size. The current code looks like this: <div id="home-gallery" class="gallery-container fullscreen"> <section id="home-welcome" class= ...

Transferring data from jQuery Ajax to PHP

I'm facing a challenge in retrieving a value back to PHP that I can manipulate and save to the database. It appears that using the GET method with jQuery AJAX is not yielding the desired results. Below is the PHP code snippet where I attempt to captur ...

Guide on transferring the properties of an object from one array object to another in jquery

var data = [ {Category: "Fruit", Name: "Apple", Color: "Red"}, {Category: "Vegetable", Name: "Carrot", Color: "Orange"}, {Category: "Fruit", Name: "Banana", Color: "Yellow"} ] var details = [ { Description: "Sweet and juicy" }, { Descr ...