A Pen by Steve Lombardi on CodePen.
Created
June 17, 2016 15:31
-
-
Save smlombardi/c86bbb0a2b423a7db6a3a318e2b2a5e4 to your computer and use it in GitHub Desktop.
centered view demo button
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
<div class="container"> | |
<div class="row col-md-9"> | |
<a href=""><img class="img-responsive" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/9340/error-401.png" alt="" /></a> | |
</div> | |
</div> |
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
/* Mixin */ | |
@mixin vertical-align($position: relative) { | |
position: $position; | |
top: 50%; | |
transform: translateY(-50%); | |
left: 50%; | |
transform: translateX(-50%); | |
} | |
a { | |
position: relative; | |
display: inline-block; | |
background-color: #000; | |
&:before { | |
content: 'View Demo'; | |
font-size: 18px; | |
display: block; | |
color: #000; | |
@include vertical-align(absolute); | |
background-color: #ccc; | |
padding: 6px 12px; | |
border-radius: 24px; | |
opacity: 0; | |
transition: opacity .3s; | |
} | |
img { | |
// filter: brightness(50%); | |
border: 1px solid #c0c0c0; | |
transition: opacity .2s; | |
opacity: 1; | |
} | |
&:hover { | |
&:before { | |
opacity: 1; | |
} | |
img { | |
opacity: .2; | |
} | |
} | |
} |
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
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment