Slideshow with Bootstrap 4 featuring miniature thumbnail previews

After incorporating a bootstrap carousel with thumbnails on my website, I noticed that the thumbnail size is too small.

I tried adjusting the CSS code within the foto_new page, but my understanding of CSS is not sufficient to fix this issue.

Below is the code for my page:

 <head>
      <title>Travel Photos</title>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <link rel="stylesheet" href="css/lo.css">
      <link rel="stylesheet" href="css/boots.css" crossorigin="anonymous">
      <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" >
    
      <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
      <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
      <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
      <style>
    
      /* Make the image fully responsive */
      .carousel-inner img {
          width: 100%;
          height: 100%;
      }
    
      #myCarousel .list-inline {
        white-space:nowrap;
        overflow-x:auto;
    }
    
    #myCarousel .carousel-indicators {
        position: static;
        left: initial;
        width: initial;
        margin-left: initial;
    }
    
    #myCarousel .carousel-indicators > li {
        <!--width: initial;-->
        <!--height: initial;-->
        width: 200px;
        height: 50px;
        text-indent: initial;
    }
    
      <!--#myCarousel .carousel-indicators li img {-->
        <!--display: block;-->
        <!--opacity: 0.5;-->
      <!--}-->
    
      #myCarousel .carousel-indicators li.active img {
        opacity: 1;
      }
    
      #myCarousel .carousel-indicators li:hover img {
        opacity: 0.75;
      }
      </style>
    </head>
    <body>
    
    <div class="container">
      <div class="row">
        <div class="col-md-12" id="middiv" style="background-color: rgba(255, 255, 255, 0.1)">
          <div id="myCarousel" class="carousel slide" data-ride="carousel" align="center">
            <div class="carousel-inner">
              <div class="carousel-item active">
                <img src="/photos/car.jpg" alt="Los Angeles" style="width:80%;">
              </div>
    
              <div class="carousel-item">
                <img src="/photos/robot.jpg" alt="Chicago" style="width:80%;">
              </div>
    
              <div class="carousel-item">
                <img src="/photos/truck.jpg" alt="New york" style="width:80%;">
              </div>
            </div>
    
            <a class="carousel-control-prev" href="#myCarousel" data-slide="prev">
              <span class="carousel-control-prev-icon"></span>
            </a>
            <a class="carousel-control-next" href="#myCarousel" data-slide="next">
              <span class="carousel-control-next-icon"></span>
            </a>
    
            <ol class="carousel-indicators list-inline">
              <li class="list-inline-item active">
                <a id="carousel-selector-0" class="selected" data-slide-to="0" data-target="#myCarousel">
                  <img src="/photos/car.jpg" class="img-fluid">
                </a>
              </li>
    
              <li class="list-inline-item">
                <a id="carousel-selector-1" data-slide-to="1" data-target="#myCarousel">
                  <img src="/photos/robot.jpg" class="img-fluid">
                </a>
              </li>
    
              <li class="list-inline-item">
                <a id="carousel-selector-2" data-slide-to="2" data-target="#myCarousel">
                  <img src="/photos/truck.jpg"  class="img-fluid">
                </a>
              </li>
             </ol>
          </div>
        </div>
      </div>
    </div>
    </body>
    </html>

I would like the thumbnails to appear larger in size.

Answer №1

Unsure how this will interact with your existing CSS styles.

 /* Ensure image responsiveness */
  .carousel-inner img {
      width: 100%;
      height: 100%;
  }

#myCarousel .carousel-indicators {
    position: static;
    margin-top:20px;
}

#myCarousel .carousel-indicators > li {
  width:100px;
}

 #myCarousel .carousel-indicators li img {
    display: block;
    opacity: 0.5;
 }

  #myCarousel .carousel-indicators li.active img {
    opacity: 1;
  }

  #myCarousel .carousel-indicators li:hover img {
    opacity: 0.75;
  }
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha256-YLGeXaapI0/5IgZopewRJcFXomhRMlYYjugPLSyNjTY=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.9.0/css/all.min.css" integrity="sha256-UzFD2WYH2U1dQpKDjjZK72VtPeWP50NoJjd26rnAdUI=" crossorigin="anonymous" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.slim.js" integrity="sha256-BTlTdQO9/fascB1drekrDVkaKd9PkwBymMlHOiG+qLI=" crossorigin="anonymous"></script>
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.15.0/esm/popper.min.js" integrity="sha256-3Iu0zFU6cPS92RSC3Pe4DBwjIV/9XKyzYTqKZzly6A8=" crossorigin="anonymous"></script> -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha256-CjSoeELFOcH0/uxWu6mC/Vlrc1AARqbm/jiiImDGV3s=" crossorigin="anonymous"></script>
<div class="container">
  <div class="row">
    <!--I am only using the middiv below because it is the only information I want to replace-->
    <div class="col-md-12" id="middiv" style="background-color: rgba(255, 255, 255, 0.1)">
      <div id="myCarousel" class="carousel slide" data-ride="carousel" align="center">
        <!-- Wrapper for slides -->
        <div class="carousel-inner">
          <div class="carousel-item active">
            <img src="https://dummyimage.com/600x400/000/fff" alt="Los Angeles" style="width:80%;">
          </div>

          <div class="carousel-item">
            <img src="https://dummyimage.com/600x400/000/fff" alt="Chicago" style="width:80%;">
          </div>

          <div class="carousel-item">
            <img src="https://dummyimage.com/600x400/000/fff" alt="New york" style="width:80%;">
          </div>
        </div>

        <!-- Left and right controls -->
        <a class="carousel-control-prev" href="#myCarousel" data-slide="prev">
          <span class="carousel-control-prev-icon"></span>
        </a>
        <a class="carousel-control-next" href="#myCarousel" data-slide="next">
          <span class="carousel-control-next-icon"></span>
        </a>

        <!-- Indicators -->
        <ol class="carousel-indicators list-inline">
          <li class="list-inline-item active">
            <a id="carousel-selector-0" class="selected" data-slide-to="0" data-target="#myCarousel">
              <img src="https://dummyimage.com/600x400/000/fff" class="img-fluid">
            </a>
          </li>

          <li class="list-inline-item">
            <a id="carousel-selector-1" data-slide-to="1" data-target="#myCarousel">
              <img src="https://dummyimage.com/600x400/000/fff" class="img-fluid">
            </a>
          </li>

          <li class="list-inline-item">
            <a id="carousel-selector-2" data-slide-to="2" data-target="#myCarousel">
              <img src="https://dummyimage.com/600x400/000/fff"  class="img-fluid">
            </a>
          </li>
         </ol>
      </div>
    </div>
  </div>
</div>

Seems adaptable to various screen sizes, and you can adjust thumbnail sizes using:

#myCarousel .carousel-indicators > li {
  width:100px;
} 

There are some issues with loading popper.js, hence it's commented out.

You can view a demo on Fiddle here: Demo

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

Looking for a solution to organize the dynamically generated list items in an HTML page

I am currently working on a movie listing website where all the movies are displayed in sequence based on their #TITLE#. The webpage is generated automatically by the software using a template file. Here is the section of code in the template file that sho ...

Ways to ensure the final unchecked checkbox stays in the checked state

I currently have a set of checkboxes that are pre-selected. However, I would like to ensure that if all checkboxes except one are unchecked, and an attempt is made to uncheck that final checked checkbox, an error message will appear and the checkbox will n ...

Utilize Jquery to hide radio buttons, while allowing users to click on an image to display a larger version

My current HTML structure is restricted to SAAS, so I only have control over jQuery implementation. https://i.stack.imgur.com/OHB9K.jpg I am attempting to achieve a similar layout as shown in the image below. The main issue lies in how to (1) conceal ...

Book Roulette: Your Next Random Read

I created a code for a random quote generator and now I want to create something similar, but with images this time. I am looking to add a feature on my page where it can recommend a book by displaying its cover image when a button is clicked. For the pre ...

Tips on maintaining the Parent menu in a hovered state when the mouse is over the child menu within a Dropdown Menu

I have been working on creating a dropdown menu that functions correctly. However, I am facing an issue where the top menu, when hovered, turns white, but as soon as I move down to the submenus, the top menu reverts back to its original color. Is there a ...

Issue with alert dismissal button not visible

I am dynamically updating the alert message: <div id="alert" hidden="hidden"> <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button> </div> $('#alert').addClass("alert alert-dan ...

The mx-auto class in Bootstrap does not properly center an element in the page

Recently, I've been working on a website that makes use of the Bootstrap 5 navbar. The design includes three navbar-navs: one with me-auto, another with mx-auto, and the last with ms-auto. Strangely enough, the navbar-nav with mx-auto, which is suppos ...

What could be preventing this code from automatically scrolling to the designated class when a key is pressed?

When a key is pressed on the document, the default action is prevented and the element with the ID "show-all-win" is animated to scroll to the position of the element with the class "key_" plus the key code of the pressed key. This animat ...

Elementor custom CSS for Wordpress header

I've been struggling to make my header transparent and then change to a colored background when scrolling down. I tried following the instructions in a video, but I couldn't find the OFFSET EFFECT setting. WEBSITE: Video: https://www.youtube.co ...

Three.js combined with Ember.js

I've been brainstorming ways to merge Ember.js with Three.js. My goal is to render multiple elements, manage the data with Ember.js bindings and general pub/sub handling, while also being able to manipulate the views/elements with three.js using THREE ...

Type the website address into the browser's address bar

Recently, I've been exploring the possibility of combining two ideas to navigate to a relative URL based on the current URL. While browsing this link, I came across the following code snippet: <script> function myFunction() { var x ...

What are some techniques for applying CSS styling directly to a custom element?

Check out this amazing resource from HTML5 Rocks about the process of creating custom elements and styling them. To create a custom element, you can use the following code: var XFoo = document.registerElement('x-foo', { prototype: Object.crea ...

How can I adjust the vertical position of Material-UI Popper element using the popper.js library?

https://i.stack.imgur.com/ZUYa4.png Utilizing a material-ui (v 4.9.5) Popper for a pop-out menu similar to the one shown above has been my recent project. The anchorElement is set as the chosen ListItem on the left side. My goal is to have the Popper alig ...

What is the best way to switch between my two images upon clicking?

When I click on an image, it changes to a different image. I achieved this by altering the source of the image upon clicking. Now, my goal is to incorporate a smooth transition between the two images after they are clicked. I attempted to stack the two im ...

Attempting to align or position the wrapper div in the center or using a float with a width of

I'm struggling to align the main div in the center of the page with a 100% width or at least float it to the left. Can someone please advise on how to achieve this? http://jsfiddle.net/d36TC/6/ <div class="addInput"><div sytle="clear:both"& ...

Positioning canvas and navigation bar with CSS styling

I have a fixed position navigation bar at the top, and a canvas. Unfortunately, the top of my canvas is being hidden behind the navigation bar. I do not want to change the canvas position to absolute. I need to position the canvas below the navigation ba ...

Default Documents on Login.aspx are being displayed even though it hasn't been specified in the web.config file

When I decided to move my website from the built-in web server (Cassini) to IIS, I encountered an issue with my Login.aspx page. The web.config file was showing an error "The requested page cannot be accessed because the related configuration data for the ...

Setting "minimum" margins in the @page CSS can be accomplished by adjusting the margin properties to ensure that

I have been exploring different methods to set margins in print-settings and discovered that one effective way is to utilize @page (or specify it directly in @media print) within scss. Setting the @page-rule for margin has yielded positive results, especia ...

Switch the style sheets after the content

How can I create a toggle effect on the :after property, switching between + and - each time the link is clicked? I've attempted to achieve this using JavaScript, CSS, and HTML, but the code only changes + to - and doesn't switch back when the l ...

Creating a responsive div class that is centered

Struggling to center my <div class="loginfeld"> while keeping it responsive. <html> <body> <div class ="loginfeld"> <div class="container"> <div class="col-lg-4"></div> ...