构建响应式网页,在head中添加bootstrap 5 的css js的cdn链接。
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>responsive-test</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-9ndCyUaIbzAi2FUVXJi0CjmCapSmO7SnpJef0486qhLnuZ2cdeRhO02iuK6FUUVM" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"
integrity="sha384-geWF76RCwLtnZ8qwWowPQNguL3RmwHVBC9FhGdlKrxdiJJigb/j/68SIy3Te4Bkz" crossorigin="anonymous">
</script>
<link rel="stylesheet" href="css/styles.css">
</head>
<body>
<div class="row">
<div class="col-lg-4 col-md-3 col-sm-12" style="background-color: yellow; border: 1px solid;">
col-lg-2 col-md-3 col-sm-12
</div>
<div class="col-lg-4 col-md-3 col-sm-12" style="background-color: yellow; border: 1px solid;">
col-lg-2 col-md-3 col-sm-12
</div>
<div class="col-lg-4 col-md-3 col-sm-12" style="background-color: yellow; border: 1px solid;">
col-lg-2 col-md-3 col-sm-12
</div>
<div class="col-lg-4 col-md-3 col-sm-12" style="background-color: yellow; border: 1px solid;">
col-lg-2 col-md-3 col-sm-12
</div>
</div>
</body>
</html>
笔记本全屏网页:
笔记本缩放等效pad网页:
笔记本缩放等效移动手机端网页 :