Link to home
Start Free TrialLog in
Avatar of Hardeep Lalli
Hardeep Lalli

asked on

Media Query issue for samsung s9+

Hi,
I am trying to make responsive website.  But I am not getting exact width and height (viewport) of  samsung s9+ (landscape and portrait mode) for media query ?
Can someone please help me out..
Avatar of Chris Stanyon
Chris Stanyon
Flag of United Kingdom of Great Britain and Northern Ireland image

Generally speaking, you shouldn't be designing your responsive site for specific devices. You should be designing it for the content.

If you take a mobile first approach, design it so it looks right on small screens (one long column with a collapsed nav, for example). Then size up your viewport until it looks 'odd'. That's your first media query (may be designed with 2 equal columns and a collapsed nav). Size up again until it looks 'odd' and thats your next view port (maybe 2/1 3 column-split and a full nav). Add as many media queries as you need so that scales across all sizes well. You'll probably end up with 3 or 4 breakpoints that will work OK across everything and aren't locked to a specifc device
Avatar of Hardeep Lalli
Hardeep Lalli

ASKER

I have not designed for a specific device but the device viewport i have selected is not reflecting on the samsung s9+. This is the reason i cannot find the exact viewport of mobile device. Although i have googled the device width of samsung that is  360px 740px. But nothing is reflecting on the mobile device.
Not sure I follow you. If you load up your page on a device with a 360px width, then the you page will show with any media queries you have set up for that size. The actual device (i.e. Samsung s9+) should be irrelevant.
Hi,

In the past dev use to fit web site per device but this is not possible anymore because too much device model size ...

You can use Bootstrap this fit the web site to the width so this fit will any device width, you can also add manual break point if you want but I never had the need for this.

The other thing is the browser, so the problem may not be related to a specific device but to a browser / browser version.
For example the basic no name browser that come with Android may sometimes not display the site as expected, I do not care about this like I do not care about IE and Edge (but this is a personal decision)... I make sure it fit ok with Chrome, Opera, Firefox

The other thing to check is the viewport meta
This is what I'm using with no problem, your page may have a different content value that may cause issues..
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1">

Open in new window

This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.