min-width 等同于>=
max-width 等同于<=
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
@media only screen and (min-width: 400px) {
div{
transition: width 2s,height 2s;
height: 400px;
width: 400px;
background: red;
}
}
@media only screen and (min-width: 800px) {
div{
transition: width 2s,height 2s;
height: 800px;
width: 800px;
background: black;
}
}
</style>
</head>
<body>
<div id="container">
</div>
</body>
</html>