media-queries

bug in chrome with media queries

核能气质少年 提交于 2021-01-27 15:50:56
问题 I have a wierd problem with media queries in chrome I added transition to some elements in my page and created for example 3 states of media queries when I resize the browser and change the state of media query my elements change size with animation, it's okey and perfect but when I try to keep the size of the browser exactly in the edge of media queries or very close to it my elements quirks and shake, sometimes slow down my page speed like slow motion when I drop the resize, the main

Retina display image resolution using media queries

﹥>﹥吖頭↗ 提交于 2021-01-27 01:30:14
问题 What is the best way to use media queries to both detect a retina display and also specify max-width ? I can detect retina using @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and ( min--moz-device-pixel-ratio: 2), only screen and ( -o-min-device-pixel-ratio: 2/1), only screen and ( min-device-pixel-ratio: 2), only screen and ( min-resolution: 192dpi), only screen and ( min-resolution: 2dppx) { } How do I add it to the media queries? Do I write @media only screen and

Changing <Video> src based on screen size with Javascript

六月ゝ 毕业季﹏ 提交于 2021-01-26 11:16:06
问题 I'm testing on building a site locally on my machine using bootstrap. I have a <video> sort of as the header of the site. I would like this video to show the full width and height on mobile, and show a cropped/wide version of the video on desktop. I tried using inline media queries in the <source> tags, so that the src would change but nothing would work. So I switched gears and used some javascript to change it that way. So the crazy thing is, it seems my script works. When I look in chrome

How can I emulate prefers-color-scheme media query in Chrome?

一笑奈何 提交于 2021-01-20 15:12:20
问题 Chrome 76 has added support for prefers-color-scheme media query (a.k.a. "dark mode"). But how can I test my webpage in both color schemes easily, without toggling the system dark mode on and off? Here is the same question for Firefox, but I can't find similar settings in Chrome & Chrome DevTools. 回答1: Since Chrome version 79 you can toggle between prefers-color-scheme: dark and prefers-color-scheme: light from the Rendering panel Open Developer tools (otherwise the key combination below

How can I emulate prefers-color-scheme media query in Chrome?

萝らか妹 提交于 2021-01-20 15:07:54
问题 Chrome 76 has added support for prefers-color-scheme media query (a.k.a. "dark mode"). But how can I test my webpage in both color schemes easily, without toggling the system dark mode on and off? Here is the same question for Firefox, but I can't find similar settings in Chrome & Chrome DevTools. 回答1: Since Chrome version 79 you can toggle between prefers-color-scheme: dark and prefers-color-scheme: light from the Rendering panel Open Developer tools (otherwise the key combination below

How can I emulate prefers-color-scheme media query in Chrome?

假装没事ソ 提交于 2021-01-20 15:07:22
问题 Chrome 76 has added support for prefers-color-scheme media query (a.k.a. "dark mode"). But how can I test my webpage in both color schemes easily, without toggling the system dark mode on and off? Here is the same question for Firefox, but I can't find similar settings in Chrome & Chrome DevTools. 回答1: Since Chrome version 79 you can toggle between prefers-color-scheme: dark and prefers-color-scheme: light from the Rendering panel Open Developer tools (otherwise the key combination below

CSS max-width has inaccurate pixel precision

ⅰ亾dé卋堺 提交于 2021-01-02 12:55:53
问题 I have an issue with max-width media rule. I test to hide the elements on different max-width values and the behavior is inconsistent. I have tested 4 scenarios varying in the screen width. Scenario 1 : Screen width is 638px: This matches my expectation. Scenario 2 : Screen width is 639px: This is wrong! I expect column639 still to be hidden! Scenario 3 : Screen width is 640px: This matches my expectation. Scenario 4 : Screen width is 641px: This matches my expectation. Question: What causes

CSS max-width has inaccurate pixel precision

北战南征 提交于 2021-01-02 12:55:20
问题 I have an issue with max-width media rule. I test to hide the elements on different max-width values and the behavior is inconsistent. I have tested 4 scenarios varying in the screen width. Scenario 1 : Screen width is 638px: This matches my expectation. Scenario 2 : Screen width is 639px: This is wrong! I expect column639 still to be hidden! Scenario 3 : Screen width is 640px: This matches my expectation. Scenario 4 : Screen width is 641px: This matches my expectation. Question: What causes

CSS max-width has inaccurate pixel precision

こ雲淡風輕ζ 提交于 2021-01-02 12:55:06
问题 I have an issue with max-width media rule. I test to hide the elements on different max-width values and the behavior is inconsistent. I have tested 4 scenarios varying in the screen width. Scenario 1 : Screen width is 638px: This matches my expectation. Scenario 2 : Screen width is 639px: This is wrong! I expect column639 still to be hidden! Scenario 3 : Screen width is 640px: This matches my expectation. Scenario 4 : Screen width is 641px: This matches my expectation. Question: What causes

CSS max-width has inaccurate pixel precision

不羁的心 提交于 2021-01-02 12:53:50
问题 I have an issue with max-width media rule. I test to hide the elements on different max-width values and the behavior is inconsistent. I have tested 4 scenarios varying in the screen width. Scenario 1 : Screen width is 638px: This matches my expectation. Scenario 2 : Screen width is 639px: This is wrong! I expect column639 still to be hidden! Scenario 3 : Screen width is 640px: This matches my expectation. Scenario 4 : Screen width is 641px: This matches my expectation. Question: What causes