Created
February 27, 2020 23:56
-
-
Save greystate/72fe4c075f4d13141f7ed9141a345c0e to your computer and use it in GitHub Desktop.
Text over image w/ CSS Grid
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
/** | |
* Text over image w/ CSS Grid | |
*/ | |
html { | |
background: #f06; | |
background: linear-gradient(45deg, #f06, yellow); | |
min-height: 100%; | |
} | |
.heroic { | |
display: grid; | |
} | |
.heroic img { | |
grid-area: 1 / 1; | |
width: 100%; | |
height: 100%; | |
object-fit: cover; | |
} | |
.heroic figcaption { | |
grid-area: 1 / 1; | |
margin: auto; | |
text-align: center; | |
font-size: 5em; | |
font-family: Helvetica, sans-serif; | |
color: #fefefe; | |
text-shadow: 0 4px 4px rgba(0, 20, 20, 0.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
<!-- content to be placed inside <body>…</body> --> | |
<figure class="heroic"> | |
<img src="https://picsum.photos/seed/chriz/800/400" width="800" height="400"> | |
<figcaption> | |
See our products! | |
</figcaption> | |
</figure> |
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
// alert('Hello world!'); |
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":"separate","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment