发布于 2024-11-18 10:57:36 字数 867 浏览 3 评论 0原文

I'm currently working on a mobile version of a website which works great in the default browsers like Firefox &铬合金。 Base is a fluid layout with a media query for a max width of 440px (@media screen and (max-width: 440px)to target portrait mode.

Font sizes are changing in the default browsers together with some other settings like smaller images and divs etc. However when I test the site on my HTC Android phone with the default browser it only shows the max width 440 style instead of the normal style which is based on a width of 480px.

What could be the problem for this behaviour? The mobile version can be found on httpp://www.seeyouzoeningouda.nl/m

Haven't posted the CSS because I really don't know which part of the code to show you. The css is based on the default HTMl5 boilerplate template (www.html5boilerplate.com)

I'm currently working on a mobile version of a website which works great in the default browsers like Firefox & Chrome. Base is a fluid layout with a media query for a max width of 440px (@media screen and (max-width: 440px)to target portrait mode.

Font sizes are changing in the default browsers together with some other settings like smaller images and divs etc. However when I test the site on my HTC Android phone with the default browser it only shows the max width 440 style instead of the normal style which is based on a width of 480px.

What could be the problem for this behaviour? The mobile version can be found on httpp://www.seeyouzoeningouda.nl/m

Haven't posted the CSS because I really don't know which part of the code to show you. The css is based on the default HTMl5 boilerplate template (www.html5boilerplate.com)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

哑剧 2024-11-25 10:57:36

您使用什么移动设备进行测试?
如果它们是三星 Galaxy s3 或苹果 iPhone 4,那么它们的设备分辨率已加倍,因此这可能是媒体查询不起作用的原因。

因此,对于 I-phone 4,尝试将最大宽度从 480 像素加倍到 960 像素,对于三星 Galaxy s3,如果在编写媒体查询时将最大宽度从 360 像素加倍到 720 像素,那么它可能会工作得很好。

例如。
@media手持设备,屏幕和(最大宽度:960px)
@media 手持设备、屏幕和(最大宽度:720px)

我认为这可能会帮助您定位纵向模式。

What mobile devices have u used for testing ?
If they are samsung galaxy s3 or apple iphone 4 then their device resolution has been doubled and hence this might be the cause for media queries not working.

So for I-phone 4 try to double the max-width from 480px to 960px and for samsung galaxy s3 if u double the max-width from 360px to 720px while writing the media query then it might work perfectly fine.

eg.
@media handheld, screen and (max-width: 960px)
@media handheld, screen and (max-width: 720px)

I think this might help you to target portrait mode.

走野 2024-11-25 10:57:36

移动设备有时会成为 @media手持设备 的目标。尝试使用 @media all 而不是 screen。

Mobile device are sometimes targeted by @media handheld. Try using @media all instead of screen.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文