<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>盒模型</title>
</head>
<body>
<!-- <div class="box"> -->
<div class="box1">
</div>
<style>
.box {
/* em绑定当年或父级的font-size */
/* width: 160px; */
font-size: 10px;
width: 10em;
height: 150px;
border: 3px solid red;
box-sizing: border-box;
}
.box2{
/* rem永远和html中的fontsize绑定 */
font-size: 10px;
width: 10rem;
height: 150px;
border: 3px solid red;
box-sizing: border-box;
}
.box1{
/* vh,vm */
/* vm可视窗口宽度的1%, vh可视窗口的高度的1% */
width: 50vw;
height: 30vh;
background-color: red;
}
</style>
</body>
</html>
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!