<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>媒体查询</title>
<style type="text/css">
div {
width: 300px;
height: 200px;
background-color: orange;
}
@media screen and (min-width: 1200px) {
div {
width: 600px;
height: 500px;
background-color: green;
}
}
</style>
<link rel="stylesheet" type="text/css" href="css/pc.css" media="screen and (max-width: 1200px)">
<link rel="stylesheet" type="text/css" href="css/ipad.css" media="screen and (max-width: 992px)">
<link rel="stylesheet" type="text/css" href="css/android.css" media="screen and (max-width: 768px)">
</head>
<body>
<div></div>
</body>
</html>
上述运行结果: