The transition duration should be around 2s. Also, the carousel shouldn't slide when its window/tab is hidden. Check the console log.
-
-
-
-
-
+
+
+
+
+
diff --git a/scss/_carousel.scss b/scss/_carousel.scss
index d9ff7e5352..43fa10077d 100644
--- a/scss/_carousel.scss
+++ b/scss/_carousel.scss
@@ -150,10 +150,10 @@
background-image: escape-svg($carousel-control-next-icon-bg);
}
-// Optional indicator pips
+// Optional indicator pips/controls
//
-// Add an ordered list with the following class and add a list item for each
-// slide your carousel holds.
+// Add an container (such as a list) with the following class and add an item (ideally a focusable control,
+// like a button) with data-bs-target for each slide your carousel holds.
.carousel-indicators {
position: absolute;
@@ -163,23 +163,26 @@
z-index: 2;
display: flex;
justify-content: center;
- padding-left: 0; // override default
+ padding: 0;
// Use the .carousel-control's width as margin so we don't overlay those
margin-right: $carousel-control-width;
+ margin-bottom: 1rem;
margin-left: $carousel-control-width;
list-style: none;
- li {
+ [data-bs-target] {
box-sizing: content-box;
flex: 0 1 auto;
width: $carousel-indicator-width;
height: $carousel-indicator-height;
+ padding: 0;
margin-right: $carousel-indicator-spacer;
margin-left: $carousel-indicator-spacer;
text-indent: -999px;
cursor: pointer;
background-color: $carousel-indicator-active-bg;
background-clip: padding-box;
+ border: 0;
// Use transparent borders to increase the hit area by 10px on top and bottom.
border-top: $carousel-indicator-hit-area-height solid transparent;
border-bottom: $carousel-indicator-hit-area-height solid transparent;
@@ -216,7 +219,7 @@
filter: $carousel-dark-control-icon-filter;
}
- .carousel-indicators li {
+ .carousel-indicators [data-bs-target] {
background-color: $carousel-dark-indicator-active-bg;
}
diff --git a/site/content/docs/5.0/components/carousel.md b/site/content/docs/5.0/components/carousel.md
index bee325bb48..689e7a6aa2 100644
--- a/site/content/docs/5.0/components/carousel.md
+++ b/site/content/docs/5.0/components/carousel.md
@@ -78,11 +78,11 @@ You can also add the indicators to the carousel, alongside the controls, too.
{{< example >}}
-
-
-
-
-
+
+
+
+
+
{{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#555" background="#777" text="First slide" >}}
@@ -111,11 +111,11 @@ Add captions to your slides easily with the `.carousel-caption` element within a
{{< example >}}
-
-
-
-
-
+
+
+
+
+
{{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#555" background="#777" text="First slide" >}}
@@ -240,11 +240,11 @@ Add `.carousel-dark` to the `.carousel` for darker controls, indicators, and cap
{{< example >}}