<section>
   <div tabindex="0">
     <button>Tab 1</button>
     <p>Tab Content #1</p>
   </div>
   <div tabindex="0">
     <button>Tab 2</button>
     <p>Content for Tab #2</p>
   </div>
   <div tabindex="0">
     <button>Tab 3</button>
     <p>#3 Tab Content</p>
   </div>
</section>

<p class="p">Demo by Tim Evko. <a href="http://www.sitepoint.com/you-dont-need-javascript-for-that" target="_blank">See article</a>.</p>
* {
  box-sizing: border-box;
}

section {
  position: relative;
  width: 606px;
  margin: 0 auto;
  z-index: 0;
  color: white;
}

section:after {
  content: 'Click on a tab above!';
  position: absolute;
  left: 0;
  top: 38px;
  width: 100%;
  font-size: 1.8em;
  text-align: center;
  background-color: #5E6B7F;
  padding: 40px 0;
}

button {
  cursor: pointer;
  width: 199px;
  display: inline-block;
  background-color: #5E6B7F;
  color: white;
  text-align: center;
  transition: .25s ease;
  border: none;
  padding: 10px;
  border-radius: 12px 12px 0 0;
}

div:focus button, button:focus {
  background-color: #8DA1BF;
  outline: none;
}

button:focus + p, div:focus P {
  display: block;
  position: absolute;
  background-color: #8DA1BF;
  height: 120px;
  width: 100%;
  left: 0;
  z-index: 2;
  outline: none;
  top: 0px;
  text-align: center;
  padding-top: 48px;
}

p {
  display: none;
  font-size: 2em;
}

div {
  display: inline-block;
}

div:focus {
  outline: none;
}

body {
  padding: 3em;
}

.p {
  margin-top: 300px;
  text-align: center;
  display: block;
  font-size: 1em;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.