# Help figuring out code for slider.

**URL:** <https://community.hubspot.com/t/help-figuring-out-code-for-slider/134241>\
**Category:** CMS Development\
**Tags:** enterprise\
**Created:** [June 10, 2025, 2:55pm UTC](https://community.hubspot.com/t/help-figuring-out-code-for-slider/134241 "2025-06-10T14:55:59Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![TaylorLioy](https://avatars.discourse-cdn.com/v4/letter/t/b9e5f3/32.png) [@TaylorLioy](https://community.hubspot.com/u/TaylorLioy)\
**Post date:** [June 10, 2025, 2:55pm UTC](https://community.hubspot.com/t/help-figuring-out-code-for-slider/134241/1 "2025-06-10T14:55:59Z")

</div>

Hi! Can you help me figure out why the header slider background won’t show the background image on each slide? I add a background to each individual slide in the module, but it won’t display the backgrounds on each slide. Only the first slide displays a background. one? [https://www.encoder.com/test12345678910?hs\_preview=WEwqEASf-182152724000](https://www.encoder.com/test12345678910?hs_preview=WEwqEASf-182152724000)

Thank you for helping!!!

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [June 10, 2025, 10:56pm UTC](https://community.hubspot.com/t/help-figuring-out-code-for-slider/134241/2 "2025-06-10T22:56:24Z")

</div>

Hey, @TaylorLioy 👋 thanks for including a link. That is always helpful for our community members. Can you share the theme you are using? Also, is the carousel module a custom coded one or was it part of your theme? One additional thing I noticed in your preview link, the last “page” of the carousel is blank, so that’s probably worth checking into as well 😉

Talk soon! — Jaycee

---

<div class="post-metadata">

**Author:** ![Anton](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/anton/32/103167_2.png) [@Anton](https://community.hubspot.com/u/Anton)\
**Post date:** [June 11, 2025, 10:00am UTC](https://community.hubspot.com/t/help-figuring-out-code-for-slider/134241/3 "2025-06-11T10:00:58Z")

</div>

Hey @TaylorLioy,

it seems like the path(s) of the background images are generated wrong.

 ![Bildschirmfoto 2025-06-11 um 11.58.29.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/9/9/994e7abf9afa8315398f6855668d63385fa8371e.png)

Do you mind sharing the module source code?

best,

Anton

---

<div class="post-metadata">

**Author:** ![TaylorLioy](https://avatars.discourse-cdn.com/v4/letter/t/b9e5f3/32.png) [@TaylorLioy](https://community.hubspot.com/u/TaylorLioy)\
**Post date:** [June 11, 2025, 2:55pm UTC](https://community.hubspot.com/t/help-figuring-out-code-for-slider/134241/4 "2025-06-11T14:55:35Z")

</div>

Hi Anton, thank you for your response! Here is the CSS:

```lia-code-sample
.carousel-cell {position: relative;}

.hhs-hero-overlay {
 position: absolute;
 top: 0;
 left: 0;
 right: 0;
 bottom: 0;
 width: 100%;
 height: 100%;
 z-index: 1;
}

.hhs-hero-slider {
 width: 100%;
 overflow: hidden;
}
.hhs-hero-slider .carousel-cell {
 width: 100%;
 height: 100%;
 background-repeat: no-repeat;
 background-size: cover;
 display: inline-table;
}

.hhs-hero-slider .carousel-cell .hhs-inner-con {
 display: table-cell;
 vertical-align: middle;
}
.hhs-hero-slider .carousel-cell .inner {
 position: relative;
 width: 100%;
 z-index: 2;

 /*-webkit-transform: translateY(-50%);
 transform: translateY(-50%);*/
 color: white;
 text-align: center;
}
.hhs-hero-slider .carousel-cell .inner .subtitle {
 font-size: 2.2rem;
 line-height: 1.2em;
 font-weight: 200;
 font-style: italic;
 letter-spacing: 3px;
 color: rgba(255, 255, 255, 0.5);
 margin-bottom: 5px;
}
.hhs-hero-slider .carousel-cell .inner .title {
 font-size: 3rem;
 line-height: 1.2em;
 text-transform: uppercase;
 letter-spacing: 3px;
 margin-bottom: 40px;
}
.hhs-hero-slider .carousel-cell .inner .btn {
 border: 1px solid #fff;
 padding: 14px 18px;
 text-transform: uppercase;
 font-size: 0.8rem;
 letter-spacing: 3px;
 color: #fff;
 text-decoration: none;
 -webkit-transition: all .2s ease;
 transition: all .2s ease;
}
.hhs-hero-slider .carousel-cell .inner .btn:hover {
 background: #fff;
 color: #000;
}
.hhs-hero-slider .flickity-prev-next-button {
 width: 80px;
 height: 80px;
 background: transparent;
}
.hhs-hero-slider .flickity-prev-next-button:hover {
 background: transparent;
}

.hhs-hero-slider .flickity-page-dots {
 bottom: 30px;
}
.hhs-hero-slider .flickity-page-dots .dot {
 width: 30px;
 height: 2px;
 opacity: 1;
 border: 0 solid white;
 border-radius: 0;
}
.hhs-hero-slider .flickity-page-dots .dot.is-selected {
 border: 0 solid #ff0000;
}

@media (max-width: 1024px) {
 .hhs-hero-slider .flickity-prev-next-button.previous {
 left: 0px; 
 }
 .hhs-hero-slider .flickity-prev-next-button.next {
 right: 0px; 
 }
}
@media (max-width: 768px) {
 .hhs-hero-slider .container {
 padding: 0 50px; 
 }
}

@media (max-width: 575px) {
 .hhs-hero-slider{
 min-height: 0;
 }
 .hhs-hero-slider .container {
 padding: 0px; 
 }
 .hhs-hero-slider .flickity-prev-next-button {display: none;}
 }

```

---

<div class="post-metadata">

**Author:** ![GRajput](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/grajput/32/102020_2.png) [@GRajput](https://community.hubspot.com/u/GRajput)\
**Post date:** [June 11, 2025, 2:33pm UTC](https://community.hubspot.com/t/help-figuring-out-code-for-slider/134241/5 "2025-06-11T14:33:23Z")

</div>

Hi @TaylorLioy

There might be a problem with either the Flickity library initialization or the HTML structure. Could you provide the full module code so I can take a closer look?

Thanks!

---

<div class="post-metadata">

**Author:** ![TaylorLioy](https://avatars.discourse-cdn.com/v4/letter/t/b9e5f3/32.png) [@TaylorLioy](https://community.hubspot.com/u/TaylorLioy)\
**Post date:** [June 11, 2025, 3:54pm UTC](https://community.hubspot.com/t/help-figuring-out-code-for-slider/134241/6 "2025-06-11T15:54:36Z")

</div>

Hi Gaurav, thanks for responding! Here is the CSS:

```lia-code-sample
.carousel-cell {position: relative;}

.hhs-hero-overlay {
 position: absolute;
 top: 0;
 left: 0;
 right: 0;
 bottom: 0;
 width: 100%;
 height: 100%;
 z-index: 1;
}

.hhs-hero-slider {
 width: 100%;
 overflow: hidden;
}
.hhs-hero-slider .carousel-cell {
 width: 100%;
 height: 100%;
 background-repeat: no-repeat;
 background-size: cover;
 display: inline-table;
}

.hhs-hero-slider .carousel-cell .hhs-inner-con {
 display: table-cell;
 vertical-align: middle;
}
.hhs-hero-slider .carousel-cell .inner {
 position: relative;
 width: 100%;
 z-index: 2;

 /*-webkit-transform: translateY(-50%);
 transform: translateY(-50%);*/
 color: white;
 text-align: center;
}
.hhs-hero-slider .carousel-cell .inner .subtitle {
 font-size: 2.2rem;
 line-height: 1.2em;
 font-weight: 200;
 font-style: italic;
 letter-spacing: 3px;
 color: rgba(255, 255, 255, 0.5);
 margin-bottom: 5px;
}
.hhs-hero-slider .carousel-cell .inner .title {
 font-size: 3rem;
 line-height: 1.2em;
 text-transform: uppercase;
 letter-spacing: 3px;
 margin-bottom: 40px;
}
.hhs-hero-slider .carousel-cell .inner .btn {
 border: 1px solid #fff;
 padding: 14px 18px;
 text-transform: uppercase;
 font-size: 0.8rem;
 letter-spacing: 3px;
 color: #fff;
 text-decoration: none;
 -webkit-transition: all .2s ease;
 transition: all .2s ease;
}
.hhs-hero-slider .carousel-cell .inner .btn:hover {
 background: #fff;
 color: #000;
}
.hhs-hero-slider .flickity-prev-next-button {
 width: 80px;
 height: 80px;
 background: transparent;
}
.hhs-hero-slider .flickity-prev-next-button:hover {
 background: transparent;
}

.hhs-hero-slider .flickity-page-dots {
 bottom: 30px;
}
.hhs-hero-slider .flickity-page-dots .dot {
 width: 30px;
 height: 2px;
 opacity: 1;
 border: 0 solid white;
 border-radius: 0;
}
.hhs-hero-slider .flickity-page-dots .dot.is-selected {
 border: 0 solid #ff0000;
}

@media (max-width: 1024px) {
 .hhs-hero-slider .flickity-prev-next-button.previous {
 left: 0px; 
 }
 .hhs-hero-slider .flickity-prev-next-button.next {
 right: 0px; 
 }
}
@media (max-width: 768px) {
 .hhs-hero-slider .container {
 padding: 0 50px; 
 }
}

@media (max-width: 575px) {
 .hhs-hero-slider{
 min-height: 0;
 }
 .hhs-hero-slider .container {
 padding: 0px; 
 }
 .hhs-hero-slider .flickity-prev-next-button {display: none;}
 }

```

---

<div class="post-metadata">

**Author:** ![TaylorLioy](https://avatars.discourse-cdn.com/v4/letter/t/b9e5f3/32.png) [@TaylorLioy](https://community.hubspot.com/u/TaylorLioy)\
**Post date:** [June 11, 2025, 5:04pm UTC](https://community.hubspot.com/t/help-figuring-out-code-for-slider/134241/7 "2025-06-11T17:04:46Z")

</div>

I figured it out! I had to remove the loop.first from the code

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [June 11, 2025, 5:32pm UTC](https://community.hubspot.com/t/help-figuring-out-code-for-slider/134241/8 "2025-06-11T17:32:03Z")

</div>

Amazing @TaylorLioy Thanks for letting us know what worked for you!
