Skip to content

Instantly share code, notes, and snippets.

@LeaVerou
Last active January 6, 2022 10:30
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save LeaVerou/83f5584b7c8e34d890e8 to your computer and use it in GitHub Desktop.
Save LeaVerou/83f5584b7c8e34d890e8 to your computer and use it in GitHub Desktop.
Media query to detect full screen mode!
/**
* 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!!" }
}
<!-- content to be placed inside <body>…</body> -->
// alert('Hello world!');
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"}
@acjbizar
Copy link

acjbizar commented Jun 8, 2016

Not sure if it matters in this case, but the “Helvetica Neue” could use some quotation marks.

@AbirHasnat
Copy link

not working...

@EnderCommunity
Copy link

It's working for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment