Heading 1
Lorem ipsum dolor sit amet consectetur adipisicing elit. Nisi sed iure perferendis deleniti possimus consequatur ducimus officia sunt minima amet!
Lorem ipsum dolor sit amet consectetur adipisicing elit. Nisi sed iure perferendis deleniti possimus consequatur ducimus officia sunt minima amet!
Heading 2
Lorem ipsum dolor sit amet consectetur adipisicing elit. Nisi sed iure perferendis deleniti possimus consequatur ducimus officia sunt minima amet!
Lorem ipsum dolor sit amet consectetur adipisicing elit. Facilis deserunt consequuntur unde aperiam deleniti amet.
Heading 3
Lorem ipsum dolor sit amet consectetur adipisicing elit. Facilis deserunt consequuntur unde aperiam deleniti amet.
Lorem ipsum dolor sit amet consectetur adipisicing elit. Nisi sed iure perferendis deleniti possimus consequatur ducimus officia sunt minima amet!
Heading 4
Lorem ipsum dolor sit amet consectetur adipisicing elit. Nisi sed iure perferendis deleniti possimus consequatur ducimus officia sunt minima amet!
Heading 5
Lorem ipsum dolor sit amet consectetur adipisicing elit. Facilis deserunt consequuntur unde aperiam deleniti amet.
Lorem ipsum dolor sit amet consectetur adipisicing elit. Nisi sed iure perferendis deleniti possimus consequatur ducimus officia sunt minima amet!
Heading 6
Lorem ipsum dolor sit amet consectetur adipisicing elit. Facilis deserunt consequuntur unde aperiam deleniti amet.
Lorem ipsum dolor sit amet consectetur adipisicing elit. Nisi sed iure perferendis deleniti possimus consequatur ducimus officia sunt minima amet!
Heading 7
Lorem ipsum dolor sit amet consectetur adipisicing elit. Facilis deserunt consequuntur unde aperiam deleniti amet.
Lorem ipsum dolor sit amet consectetur adipisicing elit. Nisi sed iure perferendis deleniti possimus consequatur ducimus officia sunt minima amet!
Heading 8
Lorem ipsum dolor sit amet consectetur adipisicing elit. Facilis deserunt consequuntur unde aperiam deleniti amet.
Lorem ipsum dolor sit amet consectetur adipisicing elit. Nisi sed iure perferendis deleniti possimus consequatur ducimus officia sunt minima amet!
Heading 9
Lorem ipsum dolor sit amet consectetur adipisicing elit. Facilis deserunt consequuntur unde aperiam deleniti amet.
Lorem ipsum dolor sit amet consectetur adipisicing elit. Nisi sed iure perferendis deleniti possimus consequatur ducimus officia sunt minima amet!
Heading 9.1
Lorem ipsum dolor sit amet consectetur adipisicing elit. Facilis deserunt consequuntur unde aperiam deleniti amet.
Lorem ipsum dolor sit amet consectetur adipisicing elit. Nisi sed iure perferendis deleniti possimus consequatur ducimus officia sunt minima amet!
Heading 10
Lorem ipsum dolor sit amet consectetur adipisicing elit. Facilis deserunt consequuntur unde aperiam deleniti amet.
Lorem ipsum dolor sit amet consectetur adipisicing elit. Nisi sed iure perferendis deleniti possimus consequatur ducimus officia sunt minima amet!
Heading 11
Lorem ipsum dolor sit amet consectetur adipisicing elit. Facilis deserunt consequuntur unde aperiam deleniti amet.
Lorem ipsum dolor sit amet consectetur adipisicing elit. Nisi sed iure perferendis deleniti possimus consequatur ducimus officia sunt minima amet!
Heading 12
Lorem ipsum dolor sit amet consectetur adipisicing elit. Facilis deserunt consequuntur unde aperiam deleniti amet.
Lorem ipsum dolor sit amet consectetur adipisicing elit. Nisi sed iure perferendis deleniti possimus consequatur ducimus officia sunt minima amet!
Heading 13
Lorem ipsum dolor sit amet consectetur adipisicing elit. Facilis deserunt consequuntur unde aperiam deleniti amet.
Lorem ipsum dolor sit amet consectetur adipisicing elit. Nisi sed iure perferendis deleniti possimus consequatur ducimus officia sunt minima amet!
Code : Copy and paste to page or post.
<style>
.tabs-container {
font-family: "Roboto", sans-serif;
max-width: 700px;
min-height: 1000px;
margin: 30px auto;
display: flex;
box-shadow: 0 4px 40px -8px rgba(0, 0, 0, 0.2);
}
.tabs-container .tabs {
width: 300px;
background: #000;
color: #fff;
text-transform: uppercase;
text-align: center;
}
.tabs-container .tabs .tab {
padding: 24px 32px;
background: #222;
cursor: pointer;
font-weight: bold;
}
.tabs-container .tabs .tab.active {
background: #C3BFF5;
color: #222;
}
.tabs-container .content-container {
background: #C3BFF5;
}
.tabs-container .content-container .content {
display: none;
padding: 32px;
}
.tabs-container .content-container .content.active {
display: block;
}
.tabs-container .content-container h3 {
margin: 0;
font-size: 30px;
}
.tabs-container .content-container p {
line-height: 2;
}
</style>
<div class="tabs-container">
<div class="tabs">
<div class="tab active">Tab 1</div>
<div class="tab">Tab 2</div>
<div class="tab">Tab 3</div>
<div class="tab">Tab 4</div>
</div>
<div class="content-container">
<div class="content active">
<h3>Heading 1</h3>
<p>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Nisi sed
iure perferendis deleniti possimus consequatur ducimus officia sunt
minima amet!
</p>
<p>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Nisi sed
iure perferendis deleniti possimus consequatur ducimus officia sunt
minima amet!
</p>
</div>
<div class="content">
<h3>Heading 2</h3>
<p>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Nisi sed
iure perferendis deleniti possimus consequatur ducimus officia sunt
minima amet!
</p>
<p>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Facilis
deserunt consequuntur unde aperiam deleniti amet.
</p>
</div>
<div class="content">
<h3>Heading 3</h3>
<p>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Facilis
deserunt consequuntur unde aperiam deleniti amet.
</p>
<p>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Nisi sed
iure perferendis deleniti possimus consequatur ducimus officia sunt
minima amet!
</p>
</div>
<div class="content">
<h3>Heading 4</h3>
<p>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Nisi sed
iure perferendis deleniti possimus consequatur ducimus officia sunt
minima amet!
</p>
</div>
</div>
</div>
<script>
const tabs = document.querySelectorAll(".tabs-container .tab");
const contents = document.querySelectorAll(".tabs-container .content");
const removeActiveClass = () => {
tabs.forEach((t) => {
t.classList.remove("active");
});
contents.forEach((c) => {
c.classList.remove("active");
});
};
tabs.forEach((t, i) => {
t.addEventListener("click", () => {
removeActiveClass();
contents[i].classList.add("active");
t.classList.add("active");
});
});
</script>
Comments
Post a Comment