<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.box{
width: 300px;
height: 300px;
background-color: red;
}
@media screen and (max-width:768px){
.box{
background-color: aqua;
}
}
@media screen and (min-width:768px) and (max-width:996px){
.box{
background-color:chartreuse;
}
}
@media screen and (min-width:996px) {
.box{
background-color:red;
}
}
</style>
</head>
<body>
<div class="box"></div>
</body>
</html>
多多关照不迷路哟!!!
谢谢