<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<style type="text/css">
*{
padding: 0;
margin:0;
}
.f{
width: 498px;
height:498px;
background:red;
padding:1px;
margin:50px auto;
}
.son{
width:200px;
height:200px;
background:yellow;
margin:150px auto;
}
</style>
</head>
<body>
<div class="f">
<div class="son"></div>
</div>
</body>
</html>
margin+padding实现居中
最新推荐文章于 2024-03-01 13:18:36 发布