渲染的时候会尽量满足,相当于设置了width=100%,height=100%,可以利用margin:auto实现水平/垂直居中
<!DOCTYPE html>
<html>
<head>
<title>document</title>
<style>
.container{
width:100px;
height:100px;
position:relative;
}
.inner-box{
background:#000;
left:0;
top:0;
bottom:0;
right:0;
position:absolute;
}
</style>
</head>
<body>
<div class="container">
<div class="inner-box"></div>
</div>
</body>
</html>