根据屏幕大小切换布局
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
屏幕自适应--栅格布局
</title>
<link rel="stylesheet" href="./css/bootstrap.min.css">
<style>
body {
background-color: rgb(170, 164, 164);
}
@media screen and (max-width: 1200px) {
body {
background-color: red;
}
}
@media screen and (max-width: 992px) {
body {
background-color: yellow;
}
}
@media screen and (max-width: 768px) {
body {
background-color: green;
}
}
@media screen and (max-width: 320px) {
body {
background-color: blue;
}
}
</style>
</head>
<body>
<script src="./js/jquery-3.2.1.min.js"></script>
<script src="./js/bootstrap.min.js"></script>
</body>
</html>