CSS 标准设备的媒体查询

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CSS 标准设备的媒体查询相关的知识,希望对你有一定的参考价值。

/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
	/* Styles */
}

/* Smartphones (landscape) ----------- */
@media only screen
and (min-width : 321px) {
	/* Styles */
}

/* Smartphones (portrait) ----------- */
@media only screen
and (max-width : 320px) {
	/* Styles */
}

/* iPads (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px) {
	/* Styles */
}

/* iPads (landscape) ----------- */
@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px)
and (orientation : landscape) {
	/* Styles */
}

/* iPads (portrait) ----------- */
@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px)
and (orientation : portrait) {
	/* Styles */
}

/* Desktops and laptops ----------- */
@media only screen
and (min-width : 1224px) {
	/* Styles */
}

/* Large screens ----------- */
@media only screen
and (min-width : 1824px) {
	/* Styles */
}

/* iPhone 4 ----------- */
@media
only screen and (-webkit-min-device-pixel-ratio : 1.5),
only screen and (min-device-pixel-ratio : 1.5) {
	/* Styles */
}

以上是关于CSS 标准设备的媒体查询的主要内容,如果未能解决你的问题,请参考以下文章

CSS 标准设备的媒体查询

CSS 媒体查询标准设备

使网站响应的标准媒体查询[重复]

CSS媒体查询及其使用

CSS 媒体查询:桌面上的设备宽度

css 特定于设备的CSS媒体查询集合