Skip to main content

Vertical Tabs in Blogger HTML,CSS,JAVA Script

Tab 1
Tab 2
Tab 3
Tab 4
Tab 5
Tab 6
Tab 7
Tab 8
Tab 9
Tab 9.1
Tab 10
Tab 11
Tab 12
Tab 13

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

Popular posts from this blog

Why doesn't air from the troposphere and the stratosphere mix freely?

• • 1.Air Temperature 2.Air Density 3.Air Pressure 4.UV High energy light 1.Cooler, Denser air & Hotter, less dense air. -Troposphere is less hot than stratosphere. Colder air stays below. Hotter air stays above. 2.Cooler, Denser air & Hotter, less dense air. -Cooler air is denser. Dense things are heavy. Heavy things stay below. Visa-versa. 3.Air pressure and the density of the air also decrease with altitude. -Temperature is directly proportional to pressure If air pressure increases, the temperature must increase.  If air pressure decreases, the temperature decreases. Up above @stratosphere pressure is less. Less pressure; less temperature. Less temperature; colder air. Because of no air turning over, Stratosphere is still hotter than Troposphere e...