Last active
May 11, 2016 08:45
-
-
Save ghetolay/15a8c70a627d0f664316 to your computer and use it in GitHub Desktop.
Border around multiple div as one
This file contains 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
/* http://codepen.io/Ghetolay/pen/PNLKpO */ | |
.container{ | |
position: relative; | |
z-index: 0; | |
} | |
$borderSize: 2px; | |
/* 1px bigger only needed when sizes are float */ | |
$coverBorderSize: $borderSize + 1px; | |
$bgColor: #f1f1f1; | |
.element{ | |
position: relative; | |
background: $bgColor; | |
outline: $borderSize solid red; | |
padding: $coverBorderSize; | |
&:before{ | |
content: ''; | |
position: absolute; | |
z-index: 1; | |
top: 0; | |
left: 0; | |
bottom: 0; | |
right: 0; | |
border: $coverBorderSize solid $bgColor; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment