(Apologies for the perplexing title)
My intention was to create a slideshow gallery, and I stumbled upon an example here: https://www.w3schools.com/howto/howto_js_slideshow_gallery.asp
In this setup, you'll notice previews of images in a small bar below the main displayed image. Each preview image is set with a width: 16.66%;
, allowing for six images to fill up 100%.
However, my task requires having multiple galleries (let's say five), each with varying numbers of images. I could manually create five distinct galleries with unique names for the preview image containers, but I'm seeking a more automated approach that can be easily scaled for additional galleries. The challenge lies in adjusting the width of the preview images accordingly.
For instance, if I desire one gallery with 11 pictures in addition to the existing one with 6 images, the required width
per preview image should be 9.09%
. Is there a way to dynamically specify different widths, such as 9.09%
for one case and 16.66%
for another, using CSS?
I appreciate your help in advance, and once again, sorry for the convoluted inquiry.