css - how to combine the logical operator NOT together with the orientation media feature -
i need target css properties device not ipad , based on device orientation.
nested media queries don't work on simulator. example
@media not screen , (device-width: 768px) , (device-height: 1024px) { @media screen , (orientation: portrait) { div { border: solid 1px yellow; } } @media screen , (orientation: landscape) { div { border: solid 1px red; } } }
the previous gives yellow borders on both orientation. never used them read might not work expected on many devices.
i cannot find way split onto separated combined queries, such as
@media screen , (orientation: portrait) , not screen , (device-width: 768px) , (device-height: 1024px) { div { border: solid 1px yellow; } } @media screen , (orientation: landscape) , not screen , (device-width: 768px) , (device-height: 1024px) { div { border: solid 1px red; } }
this never matches.
know comma separated queries logical or, tried
@media screen , (orientation: portrait), not screen , (device-width: 768px) , (device-height: 1024px) { div { border: solid 1px yellow; } } @media screen , (orientation: landscape), not screen , (device-width: 768px) , (device-height: 1024px) { div { border: solid 1px red; } }
and produces red borders.
know can overwrite css properties question how correctly use logical not operator combined orientation i'm not familiar in using operator , want learn how use , test on different devices.
from experience in identifying ipad, iphone , such apply specific layout tweaks site quite happy these hints here did trick me. http://zsprawl.com/ios/2012/03/css-for-iphone-ipad-and-retina-displays/
since you'd apply every screen-media that's not possibly ipad can limit min-device-width. i'm ignoring retina here not find device-width they'll report. in case i'd modify ipad section code linked this:
/* not ipad , portrait */ @media screen , (min-device-width: 769px) , (orientation:portrait) { } /* not ipad , landscape */ @media screen , (min-device-width: 769px) , (orientation:landscape) { }
hope you.
Comments
Post a Comment