Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome Developer Tools displaying screen larger than I set in responsive mode

I'm on chrome developer tools and opened the responsive mode. Set the width and height to mobile size (320 x 568, 360 x 640, things like that).

Media queries to mobile are not getting loaded. Both jQuery and the size-helper in the chrome dev-tools shows 980px of width, much larger than I set.

Extra info: I put my webpage in a deploy server and also used a chrome extension as a emulator because I couldn't trust the Chrome's measures.

In the deploy server it somehow works like chrome (so there is probably something weird with the code), but in the emulator plugin AND resizing the chrome window (without using the reponsive tools) I can see my breakpoints getting reached.

Anyone has faced this problem before? Can anyone at least explain why chrome is ignoring the size I ask it to be?

like image 937
Victor Ferreira Avatar asked Oct 31 '16 16:10

Victor Ferreira


People also ask

How do you change screen size of a website using Developer Tools?

Open Chrome Developer Tools. Click the Toggle Device Mode option near top left of the developer tools section. Choose Responsive from the dropdown menu at the top of the screen. Edit the dimensions, which are also at the top of screen, right next to the dropdown.

How do I zoom out of Developer Tools?

To zoom the UI of DevTools: Make sure it has focus first (click somewhere in DevTools). Use the Ctrl + + and Ctrl + - keyboard shortcuts to zoom in or out (replace Ctrl with Cmd on Mac).

How do I resize Developer Tools?

Hover your mouse to developer tools then hold the CTRL , scroll up or down the wheel of your mouse. Hold CTRL and SHIFT then press + or - , it will change your screen resolution.


2 Answers

You may need to include:

    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>

At the top of your html file...

like image 189
Daniel Kanis Avatar answered Sep 18 '22 08:09

Daniel Kanis


No need for user-scalabe=0, it works fine without it.

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
like image 44
Peter Umoren Avatar answered Sep 19 '22 08:09

Peter Umoren