By Kit the Human (edited)
Edited by Kit the Human
- 1
Need a tabbed plotter, shipper or profile application, or anything else? This code can be adapted for any use. It will not be responsive if you start putting fixed widths on the divs.
It will work on any forum software, in posts or in HTML templates. Just shove in the information you want and you're good to go.
<div class="tabbedholder"> <div class="thead"> <h2>Title Here</h2> </div> <!-- TAB ONE --> <input type="radio" name="kit-tabs" id="tab1" checked="checked" /> <label for="tab1">Tab One</label> <!-- TAB TWO --> <input type="radio" name="kit-tabs" id="tab2" /> <label for="tab2">Tab Two</label> <!-- TAB THREE --> <input type="radio" name="kit-tabs" id="tab3" /> <label for="tab3">Tab Three</label> <!-- TAB ONE STUFF --> <div class="info tab1"> <h3>Title</h3> Stuff here tab1 </div> <!-- TAB TWO STUFF --> <div class="info tab2"> <h3>Title</h3> Stuff here tab2 </div> <!-- TAB THREE STUFF --> <div class="info tab3"> <h3>Title</h3> Stuff here tab3 </div> </div> <style>.tabbedholder { background: #f9f9f9; color: #000; padding: 2%; margin: 0 auto; width: 90%; } .thead { margin: 0 0 1% 0; } .thead h2 { margin: 0; padding: 0 0 5px 0; } /* button styling */ .tabbedholder input { display: none; /* hide the radio button */ } .tabbedholder label { position: relative; /* so we can move the buttons to the right */ display: inline-block; left: 50%; /* change this as needed, try and stick to percentage values */ padding: 10px 5px; text-align: center; border: 1px solid rgba(0,0,0, 0); /* invisible border */ color: darkgray; } .tabbedholder label:hover /* alert users that something happens when they click */ { cursor: pointer; color: #1a1a1a; } /* the 'active' tab should look different */ .tabbedholder #tab1:checked ~ label[for="tab1"], .tabbedholder #tab2:checked ~ label[for="tab2"], .tabbedholder #tab3:checked ~ label[for="tab3"] { border: 1px solid #1a1a1a; border-bottom: 1px solid #f9f9f9; z-index: 1; color: #1a1a1a; } .info { border-top: 1px solid #1a1a1a; position: relative; top: -1px; display: none; } .tabbedholder #tab1:checked ~ .tab1 { display: block; } .tabbedholder #tab2:checked ~ .tab2 { display: block; } .tabbedholder #tab3:checked ~ .tab3 { display: block; }</style>
By Kit the Human (edited)
Edited by Kit the Human
By using this site, you agree to our Terms of Use, Guidelines and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.