Create Click Button Display Card Using HTML And CSS

1 / 6
Some Text
2 / 6
Some Text
3 / 6
Some Text
4 / 6
Some Text
5 / 6
Some Text
6 / 6
Some Text
BUTTON
BUTTON
BUTTON
BUTTON
BUTTON
BUTTON



Its features:

  • Total six pictures can be displayed in this display.

  • The image will be displayed as soon as the buttons are clicked.

  • It can be used as a product display card.

  • Write a brief description of your product inside the text.

Try to create like yourself by following the codes below :

Step 1) Add to folder : First make one folder and put some images that you like.
Step 2) Add to head : <meta name="viewport" content="width=device-width, initial-scale=1">
Step 3) Add to html : <h2>Create Click Button Display Card With HTML And CSS</h2> <div class="slideshow-container"> <div class="mySlides fade"> <div class="numbertext">1 / 6</div> <img src="img01.png" style="width:100%"> <div class="text">Some Text</div> </div> <div class="mySlides fade"> <div class="numbertext">2 / 6</div> <img src="2.png" style="width:100%"> <div class="text">Some Text</div> </div> <div class="mySlides fade"> <div class="numbertext">3 / 6</div> <img src="03.png" style="width:100%"> <div class="text">Some Text</div> </div> <div class="mySlides fade"> <div class="numbertext">4 / 6</div> <img src="004.png" style="width:100%"> <div class="text">Some Text</div> </div> <div class="mySlides fade"> <div class="numbertext">5 / 6</div> <img src="05.png" style="width:100%"> <div class="text">Some Text</div> </div> <div class="mySlides fade"> <div class="numbertext">6 / 6</div> <img src="6.png" style="width:100%"> <div class="text">Some Text</div> </div> </div> <div style="text-align:center"> <span class="dot" onclick="currentSlide(1)"> <div class="fifteen">BUTTON</div> </span> <span class="dot" onclick="currentSlide(2)"> <div class="fifteen">BUTTON</div> </span> <span class="dot" onclick="currentSlide(3)"> <div class="fifteen">BUTTON</div> </span> <span class="dot" onclick="currentSlide(4)"> <div class="fifteen">BUTTON</div> </span> <span class="dot" onclick="currentSlide(5)"> <div class="fifteen">BUTTON</div> </span> <span class="dot" onclick="currentSlide(6)"> <div class="fifteen">BUTTON</div> </span> </div>
Step 4) Add to css : * {box-sizing: border-box} .mySlides {display: none} img {vertical-align: middle;} .slideshow-container { max-width:400px; position: relative; margin: auto; border:5px solid #bbb; border-radius:10px; } .prev, .next { cursor: pointer; position: absolute; top: 50%; width: auto; padding: 16px; margin-top: -22px; color: white; font-weight: bold; font-size: 18px; transition: 0.6s ease; border-radius: 0 3px 3px 0; user-select: none; } .next { right: 0; border-radius: 3px 0 0 3px; } .prev:hover, .next:hover { background-color: rgba(0,0,0,0.8); } .text { color: #f2f2f2; font-size: 15px; padding: 8px 12px; position: absolute; bottom: 8px; width: 100%; text-align: center; } .numbertext { color: #f2f2f2; font-size: 12px; padding: 8px 12px; position: absolute; top: 0; } .dot { cursor: pointer; height: 35px; width: 61px; margin-top:7px; background-image: linear-gradient(#bbb, #ddd, #bbb); border-radius: 10px; display: inline-block; transition: background-color 0.6s ease; } .fifteen{ font-size:11px; margin-top:12px; } .dot:hover { background-image: linear-gradient(#aaa, #ccc, #aaa); } .fade { -webkit-animation-name: fade; -webkit-animation-duration: 1.5s; animation-name: fade; animation-duration: 1.5s; } @-webkit-keyframes fade { from {opacity: .4} to {opacity: 1} } @keyframes fade { from {opacity: .4} to {opacity: 1} } @media only screen and (max-width: 300px) { .prev, .next,.text {font-size: 11px} }
Step 5) Add to script : <script> var slideIndex = 1; showSlides(slideIndex); function plusSlides(n) { showSlides(slideIndex += n); } function currentSlide(n) { showSlides(slideIndex = n); } function showSlides(n) { var i; var slides = document.getElementsByClassName("mySlides"); var dots = document.getElementsByClassName("dot"); if (n > slides.length) {slideIndex = 1} if (n < 1) {slideIndex = slides.length} for (i = 0; i < slides.length; i++) { slides[i].style.display = "none"; } for (i = 0; i < dots.length; i++) { dots[i].className = dots[i].className.replace(" active", ""); } slides[slideIndex-1].style.display = "block"; dots[slideIndex-1].className += " active"; } </script>

Thank you sir

Congratulations to you on visiting our page.

If you have any feedback, you can give advice through the "Contact Me" form.