Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*THIS IS THE CSS*/
- .tabs {
- position: relative;
- width: /*here*/;
- height: /*here*/;
- }
- .tab {
- float: left;
- }
- .tab label {
- background: #eee;
- padding: 10px;
- border: 1px solid #ccc;
- margin-left: -1px;
- position: relative;
- left: 1px;
- top: 0px;
- }
- .tab [type=radio] {
- display: none;
- }
- .content {
- position: absolute;
- top: 28px;
- bottom: 0px;
- left: 0px;
- right: 0px;
- background: white;
- padding: 20px;
- border: 1px solid #ccc;
- }
- .tab [type=radio]:checked ~ label {
- background: white;
- border-bottom: 1px solid white;
- z-index: 2;
- }
- .tab [type=radio]:checked ~ label ~ .content {
- z-index: 1;
- }
- <!---THIS IS THE HTML--->
- <center><div class="tabs">
- <div class="tab">
- <input type="radio" id="tab-1" name="tab-group-1" checked>
- <label for="tab-1">Tab One</label>
- <div class="content">
- tab one stuff
- </div>
- </div>
- <div class="tab">
- <input type="radio" id="tab-2" name="tab-group-1">
- <label for="tab-2">Tab Two</label>
- <div class="content">
- tab two stuff
- </div>
- </div>
- <div class="tab">
- <input type="radio" id="tab-3" name="tab-group-1">
- <label for="tab-3">Tab Three</label>
- <div class="content">
- tab three stuff
- </div>
- </div>
- </div></center>
Advertisement
Add Comment
Please, Sign In to add comment