Created
December 16, 2011 14:40
-
-
Save dgmid/1486294 to your computer and use it in GitHub Desktop.
Animated HTML5 / CSS3 image caption - Example 6
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
/** | |
* Animated HTML5 / CSS3 image caption - Example 6 | |
*/ | |
/* page styles */ | |
body{ | |
background: #fff; | |
min-height:100%; | |
} | |
p { | |
width: 300px; | |
margin: 0 auto; | |
text-align: center; | |
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; | |
} | |
a:link, a:visited { | |
color: #999; | |
text-decoration: none; | |
} | |
a:hover, a:active { | |
color: #0080ff; | |
} | |
/* image caption styles */ | |
figure { | |
margin: 100px auto; | |
width: 200px; | |
height: 200px; | |
overflow: hidden; | |
position: relative; | |
} | |
figcaption { | |
position: absolute; | |
top: 0; | |
left: 0; | |
width: 200px; | |
line-height: 200px; | |
text-align: center; | |
color: #fff; | |
background-color: rgba(0,0,0,0.75); | |
font-size: 20px; | |
opacity: 0; | |
transform: rotate(60deg) scale(0,0); | |
transition: opacity .5s, transform .5s; | |
} | |
figure:hover figcaption { | |
opacity: 1; | |
transform: rotate(0deg) scale(1,1); | |
} | |
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
<!-- content to be placed inside <body>…</body> --> | |
<body> | |
<figure> | |
<img src="http://www.midwinter-dg.com/blog_demos/css3-animated-image-captions/holmavik.png" width="200" height="200" alt="Hólmavík" /> | |
<figcaption>Hólmavík</figcaption> | |
</figure> | |
<p>you can find more examples here:<br /> | |
<a href="http://www.midwinter-dg.com/blog_demos/css3-animated-image-captions/" target="_blank">css3 animated image captions</a></p> | |
</body> |
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
{"view":"split-vertical","prefixfree":"1","page":"css"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment