MASIGNASUKAv102
6510051498749449419

Full Page Tab Script By Apple Point 2021

Full Page Tab Script By Apple Point 2021
Add Comments
Tuesday, April 21, 2020
Full Page Tab Script 
Copy Code Or Download the Code

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
* {box-sizing: border-box}

/* Set height of body and the document to 100% */
body, html {
  height: 100%;
  margin: 0;
  font-family: Arial;
}

/* Style tab links */
.tablink {
  background-color: #555;
  color: white;
  float: left;
  border: none;
  outline: none;
  cursor: pointer;
  padding: 14px 16px;
  font-size: 17px;
  width: 25%;
}

.tablink:hover {
  background-color: #777;
}

/* Style the tab content (and add height:100% for full page content) */
.tabcontent {
  color: white;
  display: none;
  padding: 100px 20px;
  height: 100%;
}

#Home {background-color: #b22222;}
#News {background-color: #014421;}
#Contact {background-color: #fd5800;}
#About {background-color: #032340;}
</style>
</head>
<body>

<button class="tablink" onclick="openPage('Home', this, '#b22222')">Home</button>
<button class="tablink" id="defaultOpen" onclick="openPage('News', this, '#014421')">News</button>
<button class="tablink" onclick="openPage('Contact', this, '#fd5800')">Contact</button>
<button class="tablink" onclick="openPage('About', this, '#032340')">About</button>

<div id="Home" class="tabcontent">
  <h3>Home</h3>
  <p>Home is where the heart is..</p>
</div>

<div id="News" class="tabcontent">
  <h3>News</h3>
  <p>Some news this fine day!</p> 
</div>

<div id="Contact" class="tabcontent">
  <h3>Contact</h3>
  <p>Get in touch, or swing by for a cup of coffee.</p>
</div>

<div id="About" class="tabcontent">
  <h3>About</h3>
  <p>Who we are and what we do.</p>
</div>

<script>
function openPage(pageName,elmnt,color) {
  var i, tabcontent, tablinks;
  tabcontent = document.getElementsByClassName("tabcontent");
  for (i = 0; i < tabcontent.length; i++) {
    tabcontent[i].style.display = "none";
  }
  tablinks = document.getElementsByClassName("tablink");
  for (i = 0; i < tablinks.length; i++) {
    tablinks[i].style.backgroundColor = "";
  }
  document.getElementById(pageName).style.display = "block";
  elmnt.style.backgroundColor = color;
}

// Get the element with id="defaultOpen" and click on it
document.getElementById("defaultOpen").click();
</script>
</body>

</html>
Note:- You can change Colour Code to your Code
Home #b22222 
News #014421
Contact #fd5800
About #032340
DEMO

Home

Home is where the heart is..

News

Some news this fine day!

Contact

Get in touch, or swing by for a cup of coffee.

About

Who we are and what we do.