<!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;
border:1px solid red;
margin:50px auto;
}
.s{
width:200px;
height:200px;
background:yellow;
margin:150px auto;
}
</style>
</head>
<body>
<div class="f">
<div class="s"></div>
</div>
</body>
</html>
使用margin+border实现居中
最新推荐文章于 2022-07-14 21:01:04 发布