macbook pro 15" 的媒体查询

media Query for macbook pro 15"

我正在尝试为 15" 及更小的笔记本电脑应用媒体查询,但没有成功。

这是我的媒体查询:

@media screen and (min-device-width: 1200px) and (max-device-width: 1600px) and (-webkit-min-device-pixel-ratio: 1) { }

并且:

@media screen and (min-device-width: 1200px) and (max-device-width: 1600px) and (-webkit-min-device-pixel-ratio: 2)  and (min-resolution: 192dpi) { }

我适用于 13 英寸 macbook pro,但不适用于 15"。

如有任何帮助,我们将不胜感激。

谢谢

Retina 显示媒体查询

@media only screen and (-webkit-min-device-pixel-ratio : 1.5), only 
screen and (min-device-pixel-ratio : 1.5) { styles }

这可能是 min-device-width 的问题,因为它只能在移动设备(平板电脑、智能手机)上运行:

min-device-width

尝试使用那些(没有 -device-),以便您可以在计算机的浏览器上进行测试。

min-width or max-width

桌面样式

@media screen and (min-width: 1025px) and (max-width: 1280px) {

   /* Styles for Desktops */
 }

同时添加内部标签

<meta name="viewport" content="width=device-width, initial-scale=1">
 /*--cover up mac , mac-book---*/

@media only screen and (min-width: 1024px) and (max-width: 1920px) {}

/*--mac book pro , and mac-book retina display screen---*/

@media only screen and (min-width: 1920px) and (max-width: 2560px) {}