difference between these two media query
hey folks what's the difference between these two
and
and what will happen if remove the only keyword from the second query
6 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
okay so
@media screen
will target the screen with specified width so only @media
will target whatUnknown User•2y ago
Message Not Public
Sign In & Join Server To View
okay and what's the purpose of and as removing it will make no difference
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Right now there are three media query types: all, screen, and print.
Your first media query, without a type specified, defaults to all. Your second media query will only work for screen but won't apply any of the styles when printing (or saving as a PDF, since that uses the print functionality on most browsers).
For more info, here's the MDN page:
https://developer.mozilla.org/en-US/docs/Web/CSS/@media