I need media query code on both landscape and portrait mode for a Samsung galaxy note 5. I am using the following media query, but I think this is no right:
@media only screen and (max-width: 640px) and (orientation : landscape) {}
Am I missing something, or is this correct?
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.
Trying to go after every device is a fool's errand. Not calling you a fool, it's a saying lol ;) Devices change frequently according to their latest OS update. instead, use resolution and leave enough margin of error to account for most devices. However, if you do decide to embark in this mission, use this:
/* Portrait and Landscape */
@media screen and (device-width: 360px) and (-webkit-device-pixel-ratio: 3) {}
As long as you are using your widths to be 100% and your body has a gutter of at least 15px, your widths will adapt accordingly.
My advice, use a responsive framework such as Bootstrap, specially Bootstrap4 which it caters to large mobile devices such as iPhone6 and Notes
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