Pure CSS Image Slider with Thumbnails

Pure CSS Image Slider with Thumbnails

In this post, We will demonstrate Pure CSS Image Slider with Thumbnails. We recently created Pure CSS Content Slider, and it’s time to share you a slider with Thumbnails without using any Javascript or jquery. We do use the similar technique but code in a different way to achieve this.

It has impressive features including Next/Pre and thumbnail clickable. It is responsive and works well on all type of browsers and devices. It’s beautiful slider and has four different examples. You can take a look here.

Pure CSS Image Slider with Thumbnails

Why CSS only slider need attention? The answer is simple they are light weight and easy to customize. It reduces the page load time and stays the way you from the js errors or conflict.

You can quickly implement and play them as you want. It allows to change some images quickly and allow to add more or fewer images.

This slider is just like any javascript or jquery slider and works in the same way. You can add your animation quickly if you know the advance command of CSS3. Ok, let’s have a look how it works.

The Markup

If we look at the HTML, we will find it’s straightforward and easy to understand. All the slider HTML code hold inside a main div class name csslider. You also noted that it also have another class infinity and an ID slider1 which will handle with CSS later on.

<div class="csslider infinity" id="slider1">
  ......
</div>

Next we need to define the radio buttons, as similar other many CSS image slider do. Each radio button has unique ID also important thing to be noted is to checked="checked" element is used for first slider to set it as defult slide.

<input type="radio" name="slides" checked="checked" id="slides_1"/>
<input type="radio" name="slides" id="slides_2"/>
<input type="radio" name="slides" id="slides_3"/>
<input type="radio" name="slides" id="slides_4"/>

Now you need to define the unorder list and place your image inside. The CSS support a total number of six images, so if you need to add more, you need to change the CSS.

<ul>
    <li><img src="https://cdn.pixabay.com/photo/2016/12/13/22/25/kingfisher-1905255_960_720.jpg"/></li>
    <li><img src="https://cdn.pixabay.com/photo/2016/11/26/23/45/dog-1861839_960_720.jpg"/></li>
    <li><img src="https://cdn.pixabay.com/photo/2016/12/14/12/09/violin-1906127_960_720.jpg"/></li>
    <li><img src="https://cdn.pixabay.com/photo/2016/11/29/20/22/child-1871104_960_720.jpg"/></li>
</ul>

Last but not least, we need to define the arrows by adding the label element. We will set six labels, but you may think why six? Yep, we have four images, but we also need to set the labels for go to first and go to the last slider.

<div class="arrows">
    <label for="slides_1"></label>
    <label for="slides_2"></label>
    <label for="slides_3"></label>
    <label for="slides_4"></label>
    <label class="goto-first" for="slides_1"></label>
    <label class="goto-last" for="slides_4"></label>
</div>

In the end, we need to add the thumbnails, and we do this by using an again label with unique IDs. The ID names should be similar to radio button ID names wich we define above.

We will place each image thumbnail inside label to get it done.

<div class="navigation"> 
    <div>
      <label for="slides_1"><img width="75" height="75" src="https://cdn.pixabay.com/photo/2016/12/13/22/25/kingfisher-1905255_960_720.jpg"/></label>
      <label for="slides_2"><img width="75" height="75" src="https://cdn.pixabay.com/photo/2016/11/26/23/45/dog-1861839_960_720.jpg"/></label>
      <label for="slides_3"><img width="75" height="75" src="https://cdn.pixabay.com/photo/2016/12/14/12/09/violin-1906127_960_720.jpg"/></label>
      <label for="slides_4"><img width="75" height="75" src="https://cdn.pixabay.com/photo/2016/11/29/20/22/child-1871104_960_720.jpg"/></label>
    </div>
</div>

We are done now with the slider and let’s have a look the CSS and see the demo above and download the source code.

Hope you like it and find useful. Leave the comment and share with your friends.

You May Also Like

Leave a Reply

Your email address will not be published. Required fields are marked *