Skip to content

Instantly share code, notes, and snippets.

@amelieykw
Created April 6, 2018 15:59
Show Gist options
  • Save amelieykw/1aa1390b38e6e8b06a58c207b093d93b to your computer and use it in GitHub Desktop.
Save amelieykw/1aa1390b38e6e8b06a58c207b093d93b to your computer and use it in GitHub Desktop.
[How to tab-like div] #div #tab #HTML #CSS
.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 */
}
<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