Created
April 6, 2018 15:59
-
-
Save amelieykw/1aa1390b38e6e8b06a58c207b093d93b to your computer and use it in GitHub Desktop.
[How to tab-like div] #div #tab #HTML #CSS
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
.tabs { | |
text-align:right; | |
} | |
.tab { | |
padding:.5em 3em; | |
display:inline-block; | |
} | |
.tab2, | |
.content{ | |
background:#ccc; | |
border:2px solid #aaa; | |
border-radius:10px 0 10px 10px; | |
} | |
.tab2 { | |
border-bottom-color:#ccc; /* same as .content background */ | |
margin-bottom:-2px; /* .content border width */ | |
border-radius:20px 10px 0 0; /* tweak to preference */ | |
} |
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
<div class="tabs"> | |
<div class="tab tab1">Tab 1</div> | |
<div class="tab tab2">Tab 2</div> | |
</div> | |
<div class="content"> | |
<p>Content</p> | |
<p>Content</p> | |
<p>Content</p> | |
<p>Content</p> | |
<p>Content</p> | |
<p>Content</p> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment