Hello developers, today in this blog you’ll learn to create a Responsive Multi-tab Card Design using HTML, CSS & JavaScript.
Multi-tab is a great way to present the content to the viewers. Multi-tab is used to save the space of the website.
In this blog (Responsive Multi-tab Card Design), on the webpage, there are four tabs with labels. Those labels are Home, Gallery, About, Contact. You can create many tabs as much as you need. Whenever the user clicks on the labels, their respective tab with the content will be displayed. JavaScript code is used to perform the onclick function of the labels and in displaying their respective tabs.
The source code of this Responsive Multi-tab Card Design using HTML, CSS & JavaScript is given below, if you want the source code of this program, you can copy it. You can use this Responsive Multi-tab Card Design using HTML, CSS & JavaScript on your projects.
Responsive Multi tab Card Design using HTML, CSS & JavaScript [Source Code]
To make this website (Responsive Multi-tab Card Design), you need to create three files: an HTML file, a CSS file, and a JavaScript file.
First, create an HTML file with the name of index.html and remember, you have to create a file with a .html extension.
body {font-family: Arial;
background-color: #8BC6EC;
background-image: linear-gradient(135deg, #8BC6EC 0%, #9599E2 100%);
}
.tabs{
width:85%;
margin:55px auto 25px;
border-radius:12px;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
.tab {
overflow: hidden;
height:60px;
background-color:#1c2841;
border-radius:12px 12px 0 0 ;
}
.tab button {
background-color: inherit;
float: left;
width:25%;
height:60px;
border: none;
outline: none;
cursor: pointer;
padding: 14px 16px;
transition: 0.3s;
font-size: 17px;
background-color:#1c2841;
color:#ddd;
}
.tab button:hover {
background-color:#12192c;
}
.tab button.active {
background-color:#12192c;
color:#fff;
}
.tabcontent {
display: none;
padding: 6px 12px;
border-top: none;
background-color: #12192c;
color:#ddd;
border-radius:0 0 12px 12px;
height:450px;
}
.credit{
text-align: center;
color: #000;
font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
}
.credit a{
text-decoration: none;
color:#000;
font-weight: bold;
}
function openCity(evt, cityName) {
var i, tabcontent, tablinks;
tabcontent = document.getElementsByClassName("tabcontent");
for (i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.display = "none";
}
tablinks = document.getElementsByClassName("tablinks");
for (i = 0; i < tablinks.length; i++) {
tablinks[i].className = tablinks[i].className.replace(" active", "");
}
document.getElementById(cityName).style.display = "block";
evt.currentTarget.className += " active";
}
Thank you for reading our blog. If you face any problem in creating this Responsive Multi-tab Card Design using HTML, CSS & JavaScript, then contact us or comment us. We’ll try to provide a solution to your problem as soon as possible.
Post a Comment
Thank you
Learning robo team