What is the exact "NOT" of the following CSS media query ?
@media only screen and (device-width:768px)
Just to add, it would mean..All EXCEPT iPAD...OR.....NOT iPAD..
and BTW...I have already tried
@media not only screen and (device-width:768px)
which does not work..
To override a specific media query rule, append a new css rule after the one you want to override. For example, if the last css rule does not have a media query attached, it will override all previously declared media queries (presuming the same selectors).
Using media queries. Media queries are commonly associated with CSS, but they can be used in HTML and JavaScript as well.
You can use and to chain together multiple test conditions: @media screen and (min-width: 480px) and (max-width: 960px) { ... } To specify that only one of the conditions needs to be true (similar to or), separate the conditions with commas: @media screen and (max-width: 760px), tv and (max-width: 1200px) { ... }
Media Query Not Working on Mobile Devices If media queries work on desktop and not on mobile devices, then you most likely haven't set the viewport and default zoom. Note: You only need to add one of the code lines above, and usually, the first one does the job.
@media not screen and (device-width:768px)
not
and only
are mutually exclusive in media queries; only
is needed only to work around some downrev UAs who implement the HTML4 algorithm for media strings, so when the query starts with not
the only
is pointless.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With