Last active
January 6, 2022 10:30
-
-
Save LeaVerou/83f5584b7c8e34d890e8 to your computer and use it in GitHub Desktop.
Media query to detect full screen mode!
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
/** | |
* Media query to detect full screen mode! | |
* Y U NO WORK Chrome?? | |
* Firefox, you’re lovely. | |
*/ | |
body { | |
background: red; | |
font: bold 400% Helvetica Neue, sans-serif; | |
color: white; | |
} | |
@media (device-width: 100vw) and (device-height: 100vh) { | |
body { | |
background: green; | |
} | |
body::before { content: "Full screen!!" } | |
} |
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> --> |
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"} |
not working...
It's working for me
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Not sure if it matters in this case, but the “Helvetica Neue” could use some quotation marks.