create richtext above the images

hello,
i want to create a rich text above the images to be like this :

this is my code :
<div class=“slider-container”>
<div class=“slider-content”>
{% for item in module.field_group %}
{% if item.image_field.src %}
{% set sizeAttrs = ‘width=“{{ item.image_field.width }}” height=“{{ item.image_field.height }}”’ %}
{% if item.image_field.size_type == ‘auto’ %}
{% set sizeAttrs = ‘width=“{{ item.image_field.width }}” height=“{{ item.image_field.height }}” style=“max-width: 100%; height: auto;”’ %}
{% elif item.image_field.size_type == ‘auto_custom_max’ %}
{% set sizeAttrs = ‘width=“{{ item.image_field.max_width }}” height=“{{ item.image_field.max_height }}” style=“max-width: 100%; height: auto;”’ %}
{% endif %}
{% set loadingAttr = item.image_field.loading != ‘disabled’ ? ‘loading=“{{ item.image_field.loading }}”’ : ‘’ %}
<img src=“{{ item.image_field.src }}” alt=“{{ item.image_field.alt }}” {{ loadingAttr }} {{ sizeAttrs }}>
{% endif %}
{% inline_rich_text field=“richtext_field” value=“{{ item.richtext_field }}” %}
{% endfor %}
</div>
<input type=“range” class=“slider-bar” min=“0” max=“2” step=“1” value=“0”>
</div>

.slider-container {
width: 100%;
overflow: hidden;
white-space: nowrap;
position: relative;
margin-bottom: 20px; /* Add space between the images and the input */

}

.slider-content {
display: flex;
width: calc(100% / 3);
box-sizing: border-box;
transition: transform 0.5s ease;
margin-right: 10px; /* Add space between the images */

}

.slider-content img {
width: 100%;
height: auto;
display: block;
transition: transform 0.5s ease;
}

.slider-bar {
width: calc(100% - 20px); /* Adjust width to accommodate thumb */
background-color: red; /* Set background color */
padding: 10px; /* Optional: Add padding for visual spacing */
border-radius: 5px; /* Optional: Add border radius for rounded corners */
}
.slider-bar input[type=“range”] {
width: 100%;
height: 5px;
-webkit-appearance: none;
background-color: transparent; /* Set transparent background */
outline: none;
border-radius: 5px; /* Optional: Add border radius for track */
}

.slider-bar input[type=“range”]::-webkit-slider-thumb {
-webkit-appearance: none;
width: 20px;
height: 20px;
background-color: white; /* Set thumb color */
border-radius: 50%;
cursor: pointer;
margin-top: -8px; /* Adjust thumb position */
}

document.addEventListener(‘DOMContentLoaded’, function() {
const sliderContainer = document.querySelector(‘.slider-container’);
const slides = document.querySelectorAll(‘.slider-content img’);
const sliderBar = document.querySelector(‘.slider-bar’);

// Set initial scale for each image
slides.forEach((slide, index) => {
slide.style.transform = index === 0 ? ‘scale(1)’ : ‘scale(0.7)’;
});

sliderBar.addEventListener(‘input’, (event) => {
const value = parseInt(event.target.value);
updateScale(value);
});

function updateScale(currentIndex) {
slides.forEach((slide, index) => {
if (index === currentIndex) {
slide.style.transform = ‘scale(1)’;
} else if (index === 0 || index === slides.length - 1) {
slide.style.transform = ‘scale(0.7)’;
} else {
slide.style.transform = ‘scale(0.7)’;
}
});
}
});
please can anyone help me with that?

Hi @SBENALI9, I hope that you are well!
Great question, thank you for checking with the Community!
Just to clarify, on the screenshot, where is the rich text you’d like to have, please?
Is it the “Call transcription” text with the black background that you are trying to have?
Also, is this a HubSpot page or an external page?
Are you trying to add a rich text module within a theme?
Which theme are you using?
I’d like to invite our Top Experts to join this discussion:
Hi @stefen, @Jnix284 and @Stephanie-OG do you have suggestions to help @SBENALI9, please?
Thanks so much and have a wonderful day!
Best,
Bérangère

Hi @BérangèreL I’m not able to see the screenshots in the original post and have many of the same questions you have (what theme, what module, etc.) and looking at the code I’m not sure I’ll be able to help - hopefully one of the others will!

Hi Bérangère,

Thank you for reaching out! Yes, you’re correct. I’m looking to add rich text within the “Call transcription” section with the black background.

To provide more context, I’ve created a module specifically for images, and within this module, I’d like to incorporate the rich text.

I appreciate your help in this matter and look forward to any suggestions from the top experts.

Best regards,
sarra