Created
October 27, 2012 11:07
-
-
Save ds729/3964303 to your computer and use it in GitHub Desktop.
A CodePen by ds729. Sliding door effects using CSS - I've used border tricks to get the effect.
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="slidingdoors"> | |
<div class="slidetop"></div> | |
<div class="slideright"></div> | |
<div class="slidebottom"></div> | |
<div class="slideleft"></div> | |
<h3>follow me | |
<a href="https://twitter.com/samarkandiy" target="_blank">@samarkandiy</a> | |
</h3> | |
</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
body{ | |
background: #333 url(/images/classy_fabric.png); | |
width: 960px; | |
margin: 0 auto; | |
padding: 15px; | |
} | |
.slidingdoors div{ | |
color: #fff; | |
font-family: 'Verdana'; | |
font-weight: bold; | |
overflow: hidden; | |
width: 200px; | |
height: 100px; | |
position: relative; | |
float: left; | |
margin: 15px; | |
box-sizing: border-box; | |
transition: border .7s ease; | |
border-radius: 3px; | |
box-shadow: | |
0 0 10px #000, | |
0 0 0 5px #fff; | |
} | |
.slidetop{ | |
background: #fff url(http://azik.me/wp-content/uploads/2012/10/White-Kitten-s.jpg) bottom; | |
border-top: solid 100px #ccc; | |
} | |
.slidetop:hover{ | |
border: solid 0px; | |
} | |
.slidebottom{ | |
background: #fff url(http://azik.me/wp-content/uploads/2012/10/White-Kitten-s.jpg) top; | |
border-bottom: solid 100px #ccc; | |
} | |
.slidebottom:hover{ | |
border: solid 0px; | |
} | |
.slideleft{ | |
background: #fff url(http://azik.me/wp-content/uploads/2012/10/White-Kitten-s.jpg) right; | |
border-left: solid 200px #ccc; | |
} | |
.slideleft:hover{ | |
border: solid 0px; | |
} | |
.slideright{ | |
background: #fff url(http://azik.me/wp-content/uploads/2012/10/White-Kitten-s.jpg) left; | |
border-right: solid 200px #ccc; | |
} | |
.slideright:hover{ | |
border: solid 0px; | |
} | |
h3{ | |
font-family: "Courier"; | |
color: #fff; | |
text-align: right; | |
margin-right: 50px; | |
text-shadow: 2px 2px 3px #000; | |
} | |
h3 a{ | |
color: #fff; | |
text-decoration: none; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment