Plain CSS and Javascript Tabs

Following code demonstrates plain CSS and Javascript tabs:

<style> {
    overflow: hidden;
    border: 1px solid #ccc;
    background-color: #f1f1f1;
} button {
    background-color: inherit;
    float: left;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 14px 16px;
    font-size: 17px;
} button:hover {
    background-color: #ddd;
} {
    background-color: #ccc;

.tabcontent {
    display: none;
    padding: 6px 12px;
    border: 1px solid #ccc;
    border-top: none;

<div class="tab">
  <button class="tablinks active" onclick="openTab(event, 'London')">London</button>
  <button class="tablinks" onclick="openTab(event, 'Cairo')">Cairo</button>
  <button class="tablinks" onclick="openTab(event, 'Tokyo')">Tokyo</button>

<div id="London" class="tabcontent" style="display: block;">
  <p>London is the capital city of England.</p>

<div id="Cairo" class="tabcontent">
  <p>Cairo is the capital of Egypt.</p> 

<div id="Tokyo" class="tabcontent">
  <p>Tokyo is the capital of Japan.</p>

function openTab(evt, tabName) {
    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(tabName).style.display = "block";
    evt.currentTarget.className += " active";