我正在尝试编写一个CSS @media查询,该查询可以在我的移动设备和小于500px宽的浏览器上运行。以下内容适用于我的手机,但如果我将浏览器调整得很小,则无效。我该怎么做?
/* Smartphones and small browsers ----------- */
@media
all and (-webkit-device-pixel-ratio: 2),
screen and (resolution: 192dpi),
all and (-webkit-device-pixel-ratio: 1.3),
all and (device-aspect-ratio: 9/16) {
/* Styles */
}
/* other devices */
@media
all and (-webkit-device-pixel-ratio: 1),
screen and (resolution: 96dpi),
all and (-webkit-device-pixel-ratio: 1)
{
/* Styles */
}
答案 0 :(得分:0)
将以下行添加到媒体查询中:
all and (max-width: 500px),