Last active
November 9, 2022 07:31
-
-
Save csssecrets/d9f243ddd7dbffa341a4 to your computer and use it in GitHub Desktop.
Frosted glass 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
/** | |
* Frosted glass effect | |
*/ | |
body { | |
min-height: 100vh; | |
box-sizing: border-box; | |
margin: 0; | |
padding-top: calc(50vh - 6em); | |
font: 150%/1.6 Baskerville, Palatino, serif; | |
} | |
body, main::before { | |
background: url("http://csssecrets.io/images/tiger.jpg") 0 / cover fixed; | |
} | |
main { | |
position: relative; | |
margin: 0 auto; | |
padding: 1em; | |
max-width: 23em; | |
background: hsla(0,0%,100%,.25) border-box; | |
overflow: hidden; | |
border-radius: .3em; | |
box-shadow: 0 0 0 1px hsla(0,0%,100%,.3) inset, | |
0 .5em 1em rgba(0, 0, 0, 0.6); | |
text-shadow: 0 1px 1px hsla(0,0%,100%,.3); | |
} | |
main::before { | |
content: ''; | |
position: absolute; | |
top: 0; right: 0; bottom: 0; left: 0; | |
margin: -30px; | |
z-index: -1; | |
-webkit-filter: blur(20px); | |
filter: blur(20px); | |
} | |
blockquote { font-style: italic } | |
blockquote cite { font-style: normal; } |
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
<main> | |
<blockquote>“The only way to get rid of a temptation is to yield to it. Resist it, and your soul grows sick with longing for the things it has forbidden to itself, with desire for what its monstrous laws have made monstrous and unlawful.”</em> | |
<footer>— <cite>Oscar Wilde, The Picture of Dorian Gray</cite></footer> | |
</blockquote> | |
</main> |
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":"split","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