Issue with Bootstrap Carousel Indicators malfunctioning

I've been working on a website project for a client's portfolio, and I'm using Bootstrap Carousel in the index. The carousel showcases different projects with custom indicators made of text instead of the usual style. If you take a look at the image I have linked here, you'll see what I mean.

https://i.sstatic.net/1VQBV.jpg

Here's where I'm running into an issue: while the slides transition correctly and clicking the indicators moves to the right slide, the active state doesn't display correctly. Only the first indicator shows as "Active," even though I specified in the CSS that an active indicator should turn orange when clicked (indicating selection). The example in the image highlights the "Facebook" project in orange, but it corresponds to the image displayed from the "Clasico" project.

I'm stumped because everything seems properly implemented and in place.

HTML CODE

.carousel {
  position: absolute;
  width: 895px;
  height: 638px;
  margin: 0 auto;
  top: 50%;
  -ms-transform: translateY(-30%);
  transform: translateY(-30%);
  margin-bottom: -30px;
}

.carousel-inner img {
  max-width: 100%;
  max-heigth: 100%;
}

.carousel-caption {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.carousel-indicators {
  margin-bottom: -30px;
  text-align: left;
  float: left;
  color: #999999;
}

.carousel-indicators li,
.carousel-indicators li.other {
  width: 100px;
  background-color: transparent;
  border-radius: 0;
  text-indent: 0;
  <!-- ww w.j a va 2s . c o m-->font-family: 'Raleway', sans-serif;
  font-weight: 400;
  font-size: 19px;
  letter-spacing: 1px;
  margin: 0 2px;
}

.carousel-indicators span {
  margin-right: 20px;
}

.carousel-indicators li.active {
  color: #fcb970;
}

.carousel-indicators li:hover {
  color: #fcb970;
}
<div class="col-xs-12 col-sm-12 col-md-10 col-lg-10 col-xl-10 text-center">
  <div id="slides" class="carousel slide carousel-fade">

    <ul class="carousel-indicators">
      <li data-target="#slides" data-slide-to="0" class="active other number-01"><span>Journey </span></li>
      <li data-target="#slides" data-slide-to="1" class="other number-02"><span>Suchard </span></li>
      <li data-target="#slides" data-slide-to="2" class="other number-03"><span>Ramps </span></li>
      <li data-target="#slides" data-slide-to="3" class="other number-04"><span>Facebook </span></li>
      <li data-target="#slides" data-slide-to="4" class="other number-05"><span>Products </span></li>
      <li data-target="#slides" data-slide-to="5" class="other number-06"><span>Lab </span></li>
      <li data-target="#slides" data-slide-to="6" class="other number-07"><span>Clásico </span></li>
      <li data-target="#slides" data-slide-to="7" class="other number-08"><span>Tribute </span></li>
    </ul>
    <div class="carousel-inner">
      <div class="carousel-item active">
        <a href="https://gonzzzalo.com/work/journey"><img src="img/Journey.jpg"></a>
      </div>
      <div class="carousel-item">
        <a href="https://gonzzzalo.com/work/suchard"><img src="img/Suchard.jpg"></a>
      </div>
      <div class="carousel-item">
        <a href="https://gonzzzalo.com/work/ramps"><img src="img/Tutaller.jpg"></a>
      </div>
      <div class="carousel-item">
        <a href="https://gonzzzalo.com/work/facebook-year-on-review"><img src="img/Facebook.jpg"></a>
      </div>
      <div class="carousel-item">
        <a href="https://gonzzzalo.com/work/devices"><img src="img/Products.jpg"></a>
      </div>
      <div class="carousel-item">
        <a href="https://gonzzzalo.com/work/varios"><img src="img/LAB.jpg"></a>
      </div>
      <div class="carousel-item">
        <a href="https://gonzzzalo.com/work/clasico"><img src="img/Clasico.jpg"></a>
      </div>
      <div class="carousel-item">
        <a href="https://gonzzzalo.com/work/tribute"><img src="img/Tribute.jpg"></a>
      </div>
    </div>

  </div>
</div>

Answer №1

I've tested your code and it seems to be functioning properly. However, consider enhancing your client's SEO by including alt attributes for images.

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

`Switch up the backdrop upon selection`

I'm experimenting with bootstrap and hit a roadblock. I have radio buttons that I want to outline when not selected, and appear solid or "btn-primary" when selected. I could try achieving this with JavaScript by giving each button an individual ID, b ...

Tips for aligning text alongside ons-select elements

I am working with the following HTML snippet: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <link rel="stylesheet" href="https://unpkg.com/onsenui/css/onsenui.css"> <link rel="stylesheet" href="https://u ...

What is the process for creating custom styles for MUIV5 components?

I have incorporated Mui v5 components into my project and currently I am utilizing sx props to style all the MUI components. However, it is becoming cumbersome to add sx in every line for each component. Therefore, I am seeking alternative methods for styl ...

The system does not detect the form

I'm having trouble with my form not being recognized. I've gone over everything multiple times but still can't find the mistake. The PHP code is supposed to take the information from the form and display it, but I keep getting an error that ...

What is the best method to align a form in three columns from each side without relying on Bootstrap?

Is there a way to center the form inside a card with 3 columns on each side, so that the form appears in the middle occupying about 6 columns without relying on Bootstrap, Materialize or any similar framework? Thanks! <div class="card"> & ...

Form-check radio buttons within the form-check-inline class of Bootstrap 4.1.1

I am attempting to showcase a radio button as an inline option. According to the Bootstrap 4.1.1 documentation, the example code is: <div class="form-check form-check-inline"> <input class="form-check-input" type="radio" name="inlineRadioOption ...

I'm in need of assistance with Laravel 6 to implement a search functionality that can search for users by name, specialty, and country

Whenever I click the Search button, an error (Undefined nom) pops up. I am looking for someone who can help me troubleshoot and fix my code. Here is the code that needs correction: Controller: doctors.php <?php namespace App\Http\Cont ...

Creating a dynamic shift in background color

Is it possible to use jQuery to slowly change the color of diagonal lines in a background styled with CSS, while also adding a fading effect? I have created a fiddle with the necessary CSS to display a static background. You can view it here: http://jsfid ...

jQuery issue: Inability of "Read More" span to reappear after clicking "Read Less"

Currently in the process of creating a portfolio website that showcases project descriptions with an excerpt, revealing full details upon clicking "Read More." My experience with jQuery is limited, but I managed to implement functionality where clicking "R ...

What is the proper way to specify the background image path in CSS?

My CSS file is located at: Project/Web/Support/Styles/file.css The image I want to use is found here: Project/Web/images/image.png I am attempting to include this image in my CSS file. I have tried the following methods: 1) background-image: url(/images ...

Creating a legitimate svg element using javascript

While working with SVG, I had an issue where I added a <rect> element directly into the svg using html, and then created a new element (without namespace) <circle> with javascript. However, the <circle> element did not display in the svg ...

Styling a disabled button in ASP.NET using CSS

I've encountered an issue with my asp.net button that is disabled based on specific c# code conditions. The button, known as btnPrevious, is assigned the css class below: .btnBlue{ background: rgb(40, 108, 244); /* Old browsers */ background:linear-g ...

Tips for updating the content of a div with fresh data using a slideshow effect in jQuery

Imagine you have a div called A and an array filled with text data. When t=0, div A will display $data[0]. Then, after every n seconds, I want the div to show the next piece of data in the array. I am interested in creating a transition effect similar to ...

Adjustable / consistent box height

For hours, I've been attempting to make some divs the same height. Check out my JSfiddle here: https://jsfiddle.net/4cj5LbLs/15/ I experimented with using display: table; in the parent element and either display: table-cell; or display: table-colum ...

Ways to display distinct text boxes based on selected radio button?

Currently, I am working with JSP and have implemented an HTML form that includes a "Process" button at the top. When this button is clicked, it displays a form with two radio buttons - TestClient and TestServer. The form also contains a Submit button. If ...

The div's height is not matching the CSS declaration as expected

In my HTML, I have a div called innerDetails which serves as a flex item with the following CSS properties: .cover { height: 100vh; width: 100%; } #screenCon ...

Create a visually appealing collage using CSS without the need for traditional IMG tags

I'm currently working on a fun little project. My goal is to create a photo grid in HTML5 that displays 3x4 pictures (without using Divs) and adding all the images via CSS, meaning no img tag in the HTML file. The challenge is to make this grid respo ...

A method parameter in an MVC controller can be bound to HTML form properties by following these steps

Struggling to bind a controller post method to a basic HTML form on the view. Trying to understand how to populate the parameter and call the method using form data. Controller method: [HttpPost("addcomment")] public JsonResult AddCommen ...

What's the best way to ensure that your item list automatically updates the rendered list when an item is deleted

I've developed a web cart using Redux. The cart functions as expected, except for one issue - when I delete an item from the cart, the changes are only displayed after refreshing or navigating to another page. How can I update the view dynamically as ...

Broaden the default className attribute of the component

Greetings! I'm currently using Bootstrap with React and I am trying to figure out how to extend my component by passing className props deeper. Within my atom component, I have two separate files. The first one contains the component declaration. B ...