Tabs

Developer
Size
3,065 Kb
Views
74,888

How do I make an tabs?

Tab design using transform only to make trapezoid shape that has a border and rounded corners etc.. What is a tabs? How do you make a tabs? This script and codes were developed by Event Horizon on 11 August 2022, Thursday.

Tabs Previews

Tabs - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Tabs</title> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <a class="tab active" href="#"> <i class="fa fa-home"> </i> Tab 1</a><a class="tab" href="#"> <i class="fa fa-user"> </i> Tab 2</a><a class="tab" href="#"> <i class="fa fa-folder"> </i> Tab 3</a><a class="tab" href="#"> <i class="fa fa-gear"> </i> Tab 4</a><a class="tab" href="#"> <i class="fa fa-question"> </i> Tab 5</a> <script src='http://cdnjs.cloudflare.com/ajax/libs/classlist/2014.01.31/classList.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Tabs - Script Codes CSS Codes

.tab { position: relative; display: inline-block; width: 96px; height: 18px; padding: 8px; margin: 8px; margin-right: -16px; margin-left: 16px; text-align: center; vertical-align: top; color: #000; text-decoration: none;
}
.tab:hover:before { cursor: pointer; background-color: #ddd;
}
.tab:before { content: ""; display: inline-block; position: absolute; top: 0px; left: 0px; bottom: 0px; right: 0px; width: 100%; height: 100%; background-color: #aaa; -webkit-transform: perspective(3px) rotateX(1deg); transform: perspective(3px) rotateX(1deg); border-radius: 4px 4px 0px 0px; border: 1px solid #bbb; vertical-align: top; z-index: -1;
}
.tab:first-child { z-index: 999;
}
.tab.active:before { content: ""; display: inline-block; position: absolute; top: 0px; left: 0px; bottom: 0px; right: 0px; width: 100%; height: 100%; background-color: #eee; -webkit-transform: perspective(3px) rotateX(1deg); transform: perspective(3px) rotateX(1deg); border-radius: 4px 4px 0px 0px; border: 1px solid #bbb; vertical-align: top; z-index: -1;
}
.tab.active:hover:before { background-color: #ddd;
}
.tab:nth-child(1) { z-index: 998;
}
.tab:nth-child(2) { z-index: 997;
}
.tab:nth-child(3) { z-index: 996;
}
.tab:nth-child(4) { z-index: 995;
}
.tab:nth-child(5) { z-index: 994;
}
.tab.active { z-index: 9999;
}

Tabs - Script Codes JS Codes

document.addEventListener("DOMContentLoaded",function(){ function toggleActive(el,earray){ console.log(el+" "+earray+""); if(el.classList.contains("active")){ el.classList.remove("active"); } else{ earray.forEach(function(val1,ind1,arr1){ val1.classList.remove("active"); }); el.classList.add("active"); } } var tabs=document.getElementsByClassName("tab"); tabs=[].slice.call(tabs); tabs.forEach(function(val,ind,arr){ val.addEventListener("click",function(){ toggleActive(val,tabs); }); });
});
Tabs - Script Codes
Tabs - Script Codes
Home Page Home
Developer Event Horizon
Username Event_Horizon
Uploaded August 11, 2022
Rating 3
Size 3,065 Kb
Views 74,888
Do you need developer help for Tabs?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Event Horizon (Event_Horizon) Script Codes
Create amazing video scripts with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!