Adjust the text to match the position of this sliding image

Currently, I am facing a challenge in aligning text to various images for a presentation slider. The issue arises due to the varying number of items and the need for text in both English and Spanish languages to be accommodated regardless of length (usually up to 25 characters). While it works well for two or three items, I require a more dynamic solution as the text length can vary significantly. This current setup is purely experimental.

The images are relatively large, so I have resized them to 800px to ensure they fit perfectly within my template. However, I am unsure whether I should adjust the images themselves or attempt to modify the text content to achieve better alignment.

https://i.sstatic.net/dUo4R.png

This is my progress thus far: I have attempted to allocate row size across columns using percentages and pixels. For instance, if there are two items, each column's width should ideally be set at 50%. Unfortunately, this approach has not yielded satisfactory results, prompting me to experiment with different values (e.g., setting it at 42% for two items) without success.

 // CSS code block goes here 
<html snippet code goes here>

Answer №1

It appears that your images are not currently responsive. To ensure responsiveness, considering using .container with your images set to 100% width within the .col.

.slider-image {
    padding: 0;
    width: 100%; /*800px*/
}

For the third and fourth rows, it may be beneficial to adjust the alignment of the images so they appear centered rather than aligned at the edge. This can be an easy fix...

VIEW DEMO


If breaking down the images is an option, consider creating an SVG or CSS shape to contain them all under a single class with various variations.

VIEW DEMO

To create the shapes, introduce a new div.shape inside the .header-item. This will incorporate the bullet shape on the pseudo :before and the diamond shape on :after. Utilize the .header-item for solving border-related issues.

/* border shapes */
.header-item:before,
.header-item:after {
    bottom: 60px;
    content: '';
    position: absolute;
    width: 100%;
    z-index: -1;
}

/* vertical border */
.header-item:before {
    height: 30px;
    border-left: 1px solid #b5d8e4;
    left: calc(50% - 0.5px);
}

/* horizontal border */
.header-item:after {
    height: 0;
    border-top: 1px solid #b5d8e4;
    left: 0;
}

/* bullet & diamond */
.shape:before,
.shape:after {
    content: '';
    background-color: #fff;
    box-shadow: 0 0 0 1px #b5d8e4;
    display: block;
    margin: 0 auto;
    position: relative;
}

/* bullet */
.shape:before {
    top: 10px;
    border-radius: 50%;  
    width: 10px;
    height: 10px;
}

/* diamond */
.shape:after {
    top: 30px;
    width: 20px;
    height: 20px;  
    transform: rotate(45deg);
}

/* states */
.active .shape:before,
.active .shape:after {
    background-color: #b5d8e4;
}

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

Correctly align the div on the screen as the viewport is scrolled

I am currently working on a parallax website where the sliders are designed to slide from the left and align within the viewport as the user scrolls. However, I have encountered an issue where multiple scroll actions are required for the slide to align pro ...

The appearance of HTML dropdown select options is unappealing when viewed on iPhones

Looking for a simple alternative to the dropdown menu implementation on iPhones/iOS for a mobile website (not native app). Any suggestions using HTML/CSS/JavaScript? <!DOCTYPE html> <html> <head> <meta name="viewport" content="initi ...

items within the grid container are positioned without being constrained to rows and columns

After using the Container element, I noticed that all my grid items are displaying in columns instead of rows. How can I correct this layout issue? https://i.stack.imgur.com/9BjOA.png Click here to access the project link. ...

Setting the height for an ASP.NET ListBox control: A comprehensive guide

Is there a method to dynamically adjust the height of an asp.net's Listbox control to match the height of the table cell it is contained within? Alternatively, can the listbox control be docked inside a table cell using another approach? ...

How can AngularJS utilize variables from an external JavaScript <script> file within an HTML document?

As someone unfamiliar with AngularJS, I have a simple inquiry regarding the subject. The code on my page begins by defining an app and controller: <script> var isisApp = angular.module('isisApp', []); isisApp.controller('Acco ...

Ways to avoid overflow of dynamically added div element?

Currently, I am facing an issue while dynamically appending div elements with the .magnet class to my page. These elements end up overflowing the container boundaries and I am struggling to find a solution for this problem. If anyone could check out my j ...

Issues with aligning center vertically and horizontally using flexbox are causing unexpected behavior

Understanding the basic concepts of centering a flex container using justify-content:center and align-items: center, I am facing an alignment issue with my box. Can anyone help me with this? This is what I have attempted so far: <template> <di ...

I am perplexed by JQuery. It is returning true when comparing an input value from a number type input, and I cannot figure out the reason behind it

Seeking guidance on a perplexing issue. Here is a basic code snippet to depict my dilemma: html: <form> <input type="number" id="someNumber"> <input type="button" id="submitBtn"> </form> jquery: $("#submitBtn"). ...

The jQuery modal window is not appearing when trying to fade in

I want to set up a feedback form where all fields are filled out and the user has clicked the checkbox confirming they are not a robot. Once this is done, the Send button becomes active and a popup window will appear with a message saying "Thank you, we wi ...

Having trouble with implementing image thumbnail in Bootstrap 4 select options

Is there a solution for the Bootstrap 4 select option not displaying added image thumbnails properly? Thank you <select class="form-control" id="exampleFormControlSelect1"> <option><img src="/assets/images/platform/abs.png">AB ...

When the ::after pseudo element is utilized for creating a bottom border, it will display following each individual list item contained within the specified div

I have been using a pseudo-element to create a division line between sections, and it was working perfectly until I added a list of items. Now, the division line is appearing after every <strong> and <li> tag. I have tried various approaches, s ...

Applying position: absolute in HTML/CSS to lock parent and child elements in

Transform the boxes into concentric circles (circles within each other that share the same center). The outer circle should be black with a size of 300px and the inner circle should be white with a size of 200px. html: <div id="p10"> <div id ...

Incorporating Stripe: Enhancing Online Payments through Redirected Checkout

I am currently in the process of upgrading our checkout system to be SCA compliant. According to the documentation, I must utilize PaymentIntents for this purpose. I have followed the steps outlined in their document found at: https://stripe.com/docs/payme ...

Can CSS create a "half strikethrough" effect without relying on images?

Currently, I am in the process of developing a website that prioritizes responsiveness and speed by avoiding the use of any images. Instead, I aim to achieve desired effects solely through CSS. In the past, I would create a particular effect using the fol ...

Show side by side using javascript

My dilemma lies in having a set of cards that are meant to be displayed inline, but I have to initially hide them using "display: none". When a specific button is clicked, I aim to reveal these cards; however, upon doing so, each card seems to occupy its o ...

Issues with Node JS app's handling of php mailer code

I've made a basic website using the Node JS framework and included a php mailer for handling the contact form. Unfortunately, I'm facing issues getting it to function properly. Could it be possible that there is an underlying problem with Node JS ...

How to eliminate spacing between slides in a 3D Carousel Slider using Bootstrap 5

My website utilizes Bootstrap along with a carousel slider, which is functioning properly. However, I am encountering an issue when the slider transitions from right to left. It briefly displays a white space between slides, which I wish to eliminate. I wa ...

Resizing a column to match the dimensions of a grid of pictures

Imagine you have a website structured like this. #left_column { width: 200px; } <div id="left_column"> /* some content */ </div> <div id="right_column"> /* A series of photos each with a width of 100px and floated */ </div> In t ...

Struggling to dynamically create an identifier and data-bs-target, but experiencing difficulty in doing so

<ul> <li data-info="Amount in (₹)">{{depositeAmt}}</li> <li data-info="Status"> <button class="statusbtn Process" data-bs-toggle="collapse" data-bs-target="#colla ...

Arranging extensive menu sections and content containment

I am currently working on enhancing my website's navigation by creating a mega menu. However, I am facing issues with the organization of the divs containing the ul content. In the fiddle linked below, you can see that "Africa", "Asia", and "Oceania" ...