为什么移动专用css似乎只是针对屏幕尺寸?

时间:2022-09-10 18:28:16

I am relatively new to responsive web development and I've been confused on media queries for a while.

我对响应式Web开发相对较新,而且我对媒体查询感到困惑了一段时间。

How does this:

这是怎么回事

@media screen and (max-device-width: 320px) {}

Become iPhone specific when it only targets screen size? Wouldn't many more devices become targeted by this?

当它仅针对屏幕尺寸时,会变成iPhone特定的吗?不会有更多的设备成为这个目标吗?

I see references like this: http://stephen.io/mediaqueries/ and wonder why this is the standard.

我看到这样的引用:http://stephen.io/mediaqueries/并想知道为什么这是标准。

And is there truly a way to target iPhone only versus Android only?

是否真的有一种方法只针对iPhone而不是Android?

Much thanks.

非常感谢。

1 个解决方案

#1


0  

A media query will work on all devices. This only detects the width of a screen and nothing more.

媒体查询将适用于所有设备。这仅检测屏幕的宽度,仅此而已。

The site you were viewing was just showing specific sizes for multiple devices. An iPad screen may not be the same width as say a Android Tablet screen.

您正在查看的网站只显示了多个设备的特定尺寸。 iPad屏幕的宽度可能与Android平板电脑屏幕的宽度不同。

#1


0  

A media query will work on all devices. This only detects the width of a screen and nothing more.

媒体查询将适用于所有设备。这仅检测屏幕的宽度,仅此而已。

The site you were viewing was just showing specific sizes for multiple devices. An iPad screen may not be the same width as say a Android Tablet screen.

您正在查看的网站只显示了多个设备的特定尺寸。 iPad屏幕的宽度可能与Android平板电脑屏幕的宽度不同。