<link rel="stylesheet" media="screen and (min-width:768px) and (max-width:980px)" href="pad.css" /> <link rel="stylesheet" media="screen and (min-width:480) and (max-width: 768px)" href="phone.css" />
<link rel="stylesheet" media="screen and (max-width:320px)" href="small.css" />
四、内联样式示例
CSS Code复制内容到剪贴板
@media screen and (min-width: 980px) { //css code
} @screen and (min-width:768px) and (max-width:980px) {
//css code }
@screen and (min-width:480) and (max-width: 768px) { //css code
} @screen and (max-width:320px) {
//css code }
@media screen and (max-device-width: 480px) {
//max-device-width等于480px }
@media screen and (device-aspect-ratio: 16/9), screen and (device-aspect-ratio: 16/10) { //设备宽高比