Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do i write media query for galaxy note 5

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?

like image 814
Yasser Moussa Avatar asked Dec 22 '15 18:12

Yasser Moussa


People also ask

Why is my media query not working on mobile?

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.


1 Answers

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

like image 131
LOTUSMS Avatar answered Oct 11 '22 13:10

LOTUSMS