Last active
June 5, 2016 13:42
-
-
Save gunnarbittersmann/a1f68516180ac97962b4 to your computer and use it in GitHub Desktop.
figure caption appears
This file contains hidden or 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
| /** | |
| * figure caption appears | |
| * deprecated by http://dabblet.com/gist/e1c363fdb1212f7a5aa7c7e62c349bd3 | |
| */ | |
| * | |
| { | |
| box-sizing: border-box; | |
| } | |
| html | |
| { | |
| background: hsl(30, 60%, 90%); | |
| } | |
| figure | |
| { | |
| display: inline-block; | |
| position: relative; | |
| width: 24em; | |
| overflow: hidden; | |
| } | |
| img | |
| { | |
| display: block; | |
| width: 100%; | |
| } | |
| figcaption | |
| { | |
| position: absolute; | |
| bottom: 0; | |
| left: 0; | |
| right: 0; | |
| padding: 0 1em; | |
| background: hsla(30, 60%, 90%, 0.8); | |
| max-height: 0; | |
| transition: max-height 1s ease-in-out 0s; | |
| } | |
| figcaption::before, | |
| figcaption::after | |
| { | |
| content: ""; | |
| display: block; | |
| height: 0.5em; | |
| } | |
| figure:hover figcaption | |
| { | |
| max-height: 100vh; | |
| } | |
| figcaption span | |
| { | |
| font: 1.5em/1.5 Georgia; | |
| display: block; | |
| } | |
| .name | |
| { | |
| font-weight: bold; | |
| } |
This file contains hidden or 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
| <figure> | |
| <img src="http://upload.wikimedia.org/wikipedia/commons/3/38/Leonardo_da_Vinci_-_presumed_self-portrait_-_WGA12798.jpg" alt=""/> | |
| <figcaption> | |
| <span class="name">Leonardo da Vinci</span> | |
| <span class="title">Künstler und Wissenschaftler</span> | |
| </figcaption> | |
| </figure> |
This file contains hidden or 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
| // alert('Hello world!'); |
This file contains hidden or 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","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment