Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I add a @media query through the chrome inspector?

If I do @media(min-width: 375px) in the chrome inspector it drops my code as soon as I try to enter the body to define more of the rule.

Trying to add a media query using the chrome inspector

Is it possible to add @media rules through the inspector?

like image 503
Kit Sunde Avatar asked Nov 13 '16 10:11

Kit Sunde


People also ask

How do I add media queries in dev tools?

Activate Media Query Tool To enable it: go into responsive design mode. click the three dots menu in the top right of the screen. click "show media queries"

How do you use Chrome inspector?

One of the easiest ways to inspect a specific web element in Chrome is to simply right-click on that particular element and select the Inspect option. Clicking on the Inspect option from the right-click menu will directly open the Developer tools including the editor, Console, Sources, and other tools.

How do I request a payload in Chrome?

# New Payload tab in the Network panel Use the new Payload tab in the Network panel when you inspect a network request with payload. Previously, the payload information is available under the Headers tab.


1 Answers

It looks as though the Styles editor panel doesn't support adding @media rules. However, you can get around this by clicking on the inspector-stylesheet link to open it in the Sources panel. It is then possible to enter your @media query and the changes will be reflected immediately.

inspector-stylesheet

inspector-stylesheet editing

You can consequently see it in the Styles panel afterwards and modify the rule and CSS properties inline. It is just the initial creation that it doesn't support.

Styles panel

like image 147
Gideon Pyzer Avatar answered Sep 28 '22 14:09

Gideon Pyzer