Issue with Bootstrap 4 Carousel Indicators failing to function properly within a SASS-nested section

My current project involves creating a page with multiple sliders, each having their own indicators on the same page. I am attempting to nest the .carousel-indicators li within the corresponding section, but the indicator is not responding within that specific scope. If I remove it from the section (un-nested), it works fine, but this creates conflicts when there are multiple sliders with their own indicators.

Please note that the jfiddle provided is just an example and it seems to work fine there, although the styling is done in sass.

Any suggestions would be greatly appreciated.

//edit: Here's the link to the jfiddle with scss to see the issue more accurately 'https://jsfiddle.net/rickthewebdev/7tbLbbvy/26/'

.carousel-item {
  height: 100vh;
  width: 100%;
  min-height: 300px;
  background: no-repeat center center scroll;
  background-size: cover;
}

#section-1 {
  h1 {
    position: absolute;
    font-size: 4em;
    color: #ffff;
  }
  .carousel-indicators li {
    background-color: #fff;
    border: 1px solid #dae1ed;
    position: relative;
    bottom: 50px;
  }
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>

<!-- BEGIN SECTION 1 -->
<div id="section-1">

  <!-- SLIDER BEGIN -->
  <div class="container-fluid" id="content">
    <div id="indicators-slide-1" class="carousel slide" data-ride="carousel">

      <!-- Indicators -->
      <ol class="carousel-indicators">
        <li data-target="indicators-slide-1" data-slide-to="0" class="active"></li>
        <li data-target="indicators-slide-1" data-slide-to="1"></li>
        <li data-target="indicators-slide-1" data-slide-to="2"></li>
      </ol>

      <div class="carousel-inner" role="listbox">
        <!-- Slide One-->
        <div class="carousel-item active" style="background-image: url('https://dummyimage.com/1920x800/000/fff')">

          <h1> slide 1</h1>

        </div>
        <!-- .carousel-item -->

        <!-- Slide Two-->
        <div class="carousel-item" style="background-image: url('https://dummyimage.com/1920x800/000/fff')">

          <h1> slide 2</h1>

        </div>
        <!-- .carousel-item -->

        <!-- Slide Three-->
        <div class="carousel-item" style="background-image: url('https://dummyimage.com/1920x800/000/fff')">

          <h1>slide 3</h1>

        </div>
        <!-- .carousel-item -->
      </div>
      <!-- .carousel-inner -->

      <!-- Controls -->
      <a class="carousel-control-prev" href="#indicators-slide-1" role="button" data-slide="prev">
        <span class="carousel-control-prev-icon" aria-hidden="true"></span>
        <span class="sr-only">Previous</span>
      </a>
      <a class="carousel-control-next" href="#indicators-slide-1" role="button" data-slide="next">
        <span class="carousel-control-next-icon" aria-hidden="true"></span>
        <span class="sr-only">Next</span>
      </a>
    </div>
    <!-- controls -->
  </div>
  <!-- .container-fluid -->
</div>
<!-- .section-1 -->

Answer №1

Realized I couldn't nest BS4 carousels, as it is not supported. Managed to find a workaround by including an extra custom class for each indicator.

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

Creating a dynamic interaction between HTML forms and JavaScript using the onsubmit event handler

Having trouble getting my JavaScript file to fire when clicking the submit button on my simple HTML form. Can anyone provide some assistance? **UPDATED CODES Here is a snippet of my condensed HTML file: <html> <form name="form01" id="form01" ac ...

The use of history.pushState in Chrome triggers a request for the favicon

Code : var newurl = window.location.protocol + "//" + window.location.host + window.location.pathname +"?"+ queryStr; window.history.pushState({path:newurl},'',newurl) Current issue : There is a problem where each time wind ...

Updating the icon of a dynamically generated element in Javascript and Django depending on the query value or click event

After trying several methods, I finally found a way to change the icon on a button that was generated using a for loop on page load. Below is my element: {% for i in data %} <div class="accordion"> <div style="margin-le ...

Steps to make a div that perfectly matches the size of the image inside, ensuring responsiveness

Currently, I am in the process of creating a mobile e-mail template without the use of JavaScript. The main requirement is for the template to be responsive. My goal is to insert multiple images in a row, with the ability for the images to scale down when ...

Are there any JavaScript functions available that can navigate to a different HTML page?

Here is an example of the functionality I am attempting. Can it be implemented? function CloseHTML(){ ApplyCSSClosingTransition(); setTimeout(function() { RedirectToAnotherPage(); }, 2000); } <div onClick='CloseHTML()'&g ...

Is there a way to change a DWG file into a Flash (SWF) file?

Looking for a way to convert DWG and DXF files into SWF format directly from the client's browser. These files are currently stored on the server, and the converted file will also be saved there. I have searched for software options but haven't ...

The Bootsrap modal fails to open when triggered by a different button

Why does the login button open a signup modal instead of a login modal, even though they are configured in the same way? I renamed the login button to 'loginModel', but it still doesn't work as expected. However, the sign-up button works cor ...

Having issues with the Bootstrap popup model functionality on my website

I am facing an issue with the Bootstrap popup not displaying correctly on my website. I utilized the code directly from the official Bootstrap website for the popup implementation. You can find my website at this link: Link to webiste The placement of th ...

Ways to eliminate the default margin surrounding an image within a div

Struggling with CSS while building websites is a common issue for me. In my current project, I have encountered a challenge where I placed two images inside a div container. Oddly enough, when I add text to the div, it adjusts its height accordingly. How ...

How can I shift an element without adjusting the padding to prevent border or margin collapse?

Is there a way to move HTML elements without the use of padding, as I need a border for color and want to avoid collapsing with other elements in the structure? Or is this the only option and should I just avoid colliding with other elements? "Margin is t ...

I am experiencing an issue with setting the border to none using .navbar-toggler

I'm currently utilizing bootstrap 5, and I've encountered an issue with setting the border and outline to none in my CSS file. Specifically, when I apply these properties to the nav-toggler class, it seems to have no effect. .menu-bar .navbar- ...

Building a multi-form application with HTML5 validation and Vue.js

I am working on a vue.js form that consists of multiple steps and requires HTML5 validation to be simplified. Here is a snippet of the code: <template> <div> <div v-if="activeForm === 1"> <h2> ...

Issue with Ionic3: When using ElementRef nativeElement.getElementsByClassName, the returned collection is inaccessible

I've been following a tutorial on Ionic and directives, and everything seems to be working fine except for one thing. When I try to retrieve the FAB element using ElementRef's nativeElement.getElementsByClassName method, it returns undefined. Str ...

Is there a way to adjust the margin for a child DIV element using CSS?

Currently, I am working on my website located at www.buildinghunter.com. On the homepage, there are four div elements positioned in the bottom left corner of the page. I am attempting to align two specific divs (id=text-9 and id=text-10) with the other tw ...

Circular gradient in ring shape with CSS

How can I create a "ring" shape with a specific thickness (in pixels) using radial gradient in HTML and CSS? I want to achieve a smooth color transition from green to transparent, like this: https://i.sstatic.net/mF54O.png Currently, my code only produce ...

Troubleshooting Printing Issues on WordPress

After conducting a thorough search on Google to find solutions for this issue, I discovered that most of the fixes are specific to certain themes. While I did come across a suggestion to create a print.css file which partially solved the problem by printin ...

Simple steps to increase the gap between columns in Bootstrap 4

I created a container with 3 columns using Bootstrap 4: <section id="features"> <div class="container-fluid"> <div class="row justify-content-around"> <div class="col-lg-4 col-md-12 "> <i class="fa ...

Bootstrap is experiencing some glitches

While working on implementing an admin panel into my bootstrap template, I encountered a problem. When I tried to change the slider elements into a loop to retrieve data from the database and display them as list items, the theme ended up broken. Despite h ...

Managing iframes in React using reference methods

Trying to set the content of an iframe within a React component can be a bit tricky. There is a component that contains a handleStatementPrint function which needs to be called when the iframe finishes loading. The goal is to print the loaded iframe conten ...

Is there a way to retrieve all spans within td elements by clicking outside of a button?

I have been reading a lot of articles about how to use the $(function(){ .... function to retrieve values from HTML table child elements. However, I am unable to do so successfully and would appreciate your help. My attempts are not yielding the desired ...