Chrome Device Mode Emulation Media Queries Not Working
I fixed this problem by adding a meta tag to my page:
<meta name="viewport" content="width=device-width">
UPDATE (December 2019):
It looks like you may also need to set the initial scale and minimum scale, like so:
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
Chrome dev tools honors media queries, but browser doesn't
After looking at your video, the media queries look like the issue. You are checking for device width, which the browser sees as the FULL SIZE of your screen, rather than the width of the browser.
Try writing them like this:
@media all and (min-width: 1251px) and (max-width: 2600px) {
*/ code here /*
}
Notice it is checking just for the min-width
rather than min-device-width
.
I suggest you also have a read of these: https://css-tricks.com/css-media-queries/ and http://bradfrost.com/blog/post/7-habits-of-highly-effective-media-queries/ to get more of a grasp on how they work.
Responsive media query not working in Google Chrome
add this line in <head>
<meta name="viewport" content="width=device-width,initial-scale=1">
CSS media queries not showing up in chrome inspector
I tried to test different screen sizes and apply media queries by changing the size of the viewport in chrome's developer tools like this:
Apparently, this is not how the media queries works and you need to resize the browser to test different media queries for different screen sizes!
Related Topics
How to Use/Emulate Regex-Like Backreferences in Attribute Selectors
Extracting Only the CSS Used in a Specific Page
How to Target All <H> Tags with a Single Selector
How to Horizontally Center a Floating Element of a Variable Width
Issue When Centering Vertically with Flexbox When Heights Are Unknown
How to Define a Class Name on Paragraph Using Markdown
Bootstrap - Removing Padding or Margin When Screen Size Is Smaller
Using @Font-Face with Rails 3.1 App
Chrome Issue with Background-Attachment Fixed and Position Fixed Elements
:Nth-Letter Pseudo-Element Is Not Working
Pass Function or Mixin by Reference in SASS
Is There a Reason Why CSS Doesn't Support Ids and Classes, Starting from Numbers