Created
March 20, 2011 00:55
-
-
Save Rob-ot/877963 to your computer and use it in GitHub Desktop.
CSS only tabs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>CSS Nav thing</title> | |
| <style type='text/css'> | |
| input { | |
| display: none; | |
| } | |
| #link1:checked ~ #content1, | |
| #link2:checked ~ #content2, | |
| #link3:checked ~ #content3, | |
| #link4:checked ~ #content4 { | |
| display:block; | |
| } | |
| label { | |
| cursor: pointer; | |
| } | |
| .content { | |
| display:none; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <label for='link1'>Tab 1</label> | |
| <input type='radio' id='link1' name='nav' checked='checked'> | |
| <label for='link2'>Tab 2</label> | |
| <input type='radio' id='link2' name='nav'> | |
| <label for='link3'>Tab 3</label> | |
| <input type='radio' id='link3' name='nav'> | |
| <label for='link4'>Tab 4</label> | |
| <input type='radio' id='link4' name='nav'> | |
| <div id='content1' class='content'>one</div> | |
| <div id='content2' class='content'>two</div> | |
| <div id='content3' class='content'>three</div> | |
| <div id='content4' class='content'>four ;)</div> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment