Showing client logos on your website helps build trust and shows your credibility. In this blog post, we will learn how to create a simple and effective client logo slider using HTML and CSS without additional libraries. This slider will smoothly display client logos, enhancing the professional appearance of your site.
Video Tutorial for Logo Slider
I created a detailed video tutorial about how to create client logo slider using HTML and CSS. In the video, I’ve explained everything in simple terms and made it easy to follow, even if you’re a beginner.
HTML
First we create the container for the client logos. We use the <marquee> tag to create a scrolling effect. Inside this tag, there is a list of client logos, each placed in a <div> element. Each logo is shown using an <img> tag.
<div class="main-logo">
<h3>Our Clients</h3>
<div class="clients">
<div class="brand"><img src="./assets/brand_1.png" alt="Brand 1"/></div>
<div class="brand"><img src="./assets/brand_2.png" alt="Brand 2"/></div>
<div class="brand"><img src="./assets/brand_3.png" alt="Brand 3"/></div>
<div class="brand"><img src="./assets/brand_4.png" alt="Brand 4"/></div>
<div class="brand"><img src="./assets/brand_5.png" alt="Brand 5"/></div>
<div class="brand"><img src="./assets/brand_6.png" alt="Brand 6"/></div>
<div class="brand"><img src="./assets/brand_7.png" alt="Brand 7"/></div>
<div class="brand"><img src="./assets/brand_8.png" alt="Brand 8"/></div>
</div>
</div>
CSS
The CSS makes sure the logos are lined up properly and look good. It includes margins, font settings for the heading, and space between the logos.
h3{
font-size: 35px;
text-align: center;
margin: 40px 0 20px 0;
font-family: 'Courier New', Courier, monospace;
}
.clients{
display: flex;
align-items: center;
}
.brand{
margin-right: 80px;
}
How it Works
- The <marquee> tag scrolls the client logos horizontally across the screen. You can adjust the behavior and direction attributes to customize the scrolling effect.
- The .clients class ensures the logos are displayed in a row using the flex layout.
- Each logo has spacing (margin-right) to make them visually distinct.
Conclusion
The <marquee> tag may work here, but it's old and not suitable for today's web design. Instead, try using CSS animations or JavaScript sliders like Swiper.js or Slick for a better option. Still, this example shows a simple way to create a logo slider without needing extra libraries.