A Pen by antonio-ventura

undefined

Forked from Tim's Pen jaoLv.

Thumbnail
This awesome code was written by antonio-ventura, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright antonio-ventura ©

Technologies

  • HTML
  • CSS
  • JavaScript
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>A Pen by  antonio-ventura</title>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.min.js" type="text/javascript"></script>


    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css">

  
      <link rel="stylesheet" href="css/style.css">

  
</head>

<body>

   <section>
  <div tabindex="1">
    <span>tab 1</span>
    <p>I'm hidden content for tab 1!</p>
  </div>
  <div tabindex="1">
    <span>tab 2</span>
    <p>I'm hidden content for tab 2!</p>
  </div>
  <div tabindex="1">
    <span>tab 3</span>
    <p>I'm hidden content for tab 3!</p>
  </div>
</section>
  <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>

  

    <script  src="js/index.js"></script>




</body>

</html>

/*Downloaded from https://www.codeseek.co/antonio-ventura/a-pen-by-antonio-ventura-AaIbe */
section {
  position: relative;
  width: 608px;
  margin: 0 auto;
}
section:after {
  content: 'Click on a tab above!';
  position: absolute;
  left: 0;
  top: 35px;
  width: 100%;
  text-align: center;
  background-color: #E9F0C8;
  padding: 40px 0;
}

div {
  width: 200px;
  display: inline-block;
  background-color: purple;
  color: white;
  text-align: center;
  transition: .25s ease;
}
div span {
  cursor: pointer;
  display: block;
  width: 100%;
}
div:focus {
  outline: none;
  background-color: orange;
}
div:focus p {
  display: block;
  position: absolute;
  background-color: gray;
  height: 100px;
  width: 100%;
  left: 0;
  z-index: 2;
}

p {
  display: none;
}

body {
  padding: 3em;
}

/*Downloaded from https://www.codeseek.co/antonio-ventura/a-pen-by-antonio-ventura-AaIbe */
//nope

Comments