<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>demo</title>
<style type="text/css" media="screen">
.d1{
300px;
height:150px;
border:1px solid #000;
padding:10px;
/*box-sizing:border-box; 规定宽和高从border开始算起*/
/*box-sizing:content-box; 默认 规定宽和高只是content部分不包括padding和border*/
}
.d2{
100%;
height:100%;
background: red;
}
</style>
</head>
<body>
<div class="d1">
<div class="d2">
</div>
</div>
</body>
</html>