Created
May 24, 2013 06:52
-
-
Save rinatio/5641730 to your computer and use it in GitHub Desktop.
Simple hover info with css
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
.hover-info { | |
$pd: 20px; // Padding | |
$bd: 1px; // Border width | |
$bdr: 8px; // Border radius | |
$bdc: rgba(0, 0, 0, 0.1); // Border color | |
$bsh: 2px 2px 2px rgba(0, 0, 0, 0.2); // Box shadow | |
.hover-details { | |
display: none; | |
} | |
&:hover { | |
position: relative; | |
background: white; | |
z-index: 100; | |
border-radius: $bdr $bdr 0 0; | |
border: $bd solid $bdc; | |
border-bottom: none; | |
margin: -#{$pd+$bd} -#{$pd+$bd} 0; | |
padding: $pd $pd 0; | |
box-shadow: $bsh; | |
.hover-details { | |
display: inline-block; | |
position: absolute; | |
background: white; | |
right: 0; | |
left: 0; | |
border-color: $bdc; | |
border-width: $bd; | |
border-style: none solid solid; | |
border-radius: 0 0 $bdr $bdr; | |
margin: 0 -#{$bd} -#{$bd}; | |
padding: 0 $pd $pd; | |
box-shadow: $bsh; | |
} | |
} | |
// Clearfix for vertical margin collapsing | |
&:before, | |
&:after { | |
display: table; | |
line-height: 0; | |
content: ""; | |
} | |
&:after { | |
clear: both; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment