简体   繁体   English

BUG - iOS 设备上的 CSS 媒体查询

[英]BUG - CSS media queries on iOS devices

I'm having problems with my CSS media queries on iOS devices.我在 iOS 设备上的 CSS 媒体查询有问题。 I tried with and iPhone 11 Pro (safari, xcode simulator) and and iPad Air 2 (Google Chrome)我尝试使用 iPhone 11 Pro(Safari,xcode 模拟器)和 iPad Air 2(谷歌浏览器)

https://docs.google.com/presentation/d/1aNMcbX73dEDlokOhm2XPBkEjxCH_2iINBV3BbAT9-q4/edit?usp=sharing https://docs.google.com/presentation/d/1aNMcbX73dEDlokOhm2XPBkEjxCH_2iINBV3BbAT9-q4/edit?usp=sharing

The first slide shows how my website looks on the default Chrome configuration;第一张幻灯片显示了我的网站在默认 Chrome 配置下的外观; mobile.移动的。 As you can notice, it takes the media queries from a smartphone, instead of the 1024px media query I wrote.正如您所注意到的,它从智能手机获取媒体查询,而不是我编写的 1024px 媒体查询。

The second slide is after requesting desktop view how it should look according to the media queries.第二张幻灯片是在根据媒体查询请求桌面视图之后。

The third slide shows media queries applies properly on Android phone and not properly on Safari on an iPhone simulator.第三张幻灯片显示媒体查询在 Android 手机上正确应用,但在 iPhone 模拟器上不适用于 Safari。

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

I wrote this html meta tag like this and nothing changes.我像这样写了这个 html 元标记,没有任何变化。

Source code if required.如果需要源代码。

https://github.com/erickcm2k/newProjectPortfolio/tree/master/portfolio https://github.com/erickcm2k/newProjectPortfolio/tree/master/portfolio

Update更新

Here is the path to my CSS reset file i got from: https://meyerweb.com/eric/tools/css/reset/这是我从以下位置获得的 CSS 重置文件的路径: https://meyerweb.com/eric/tools/css/reset/

https://github.com/erickcm2k/newProjectPortfolio/blob/master/portfolio/src/Containers/reset.css https://github.com/erickcm2k/newProjectPortfolio/blob/master/portfolio/src/Containers/reset.css

Everything worked fine after commenting this line评论此行后一切正常

  -webkit-text-size-adjust: 62.5%; /* Line 205 */

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM