弹性盒子
<style>
{
padding: 0;
margin: 0;
}
.wrap
{
width: 200px;
height: 200px;
border:1px solid greenyellow;
margin: 100px auto;
display: flex;
flex-direction: column;
justify-content: center;
align-items:center;
}
.yuan
{
width: 50px;height: 50px;
background-color: brown;
border-radius: 50%;
}
.fang{
width: 100px;
height: 40px;
background-color: skyblue;
margin-top: 20px;
}
</style>
<div class="wrap">
<div class="yuan" </div>
<div class="fang"></div>
</div>
本文介绍了一个使用CSS flexbox实现的弹性盒子布局示例,展示了如何通过设置display:flex、flex-direction、justify-content和align-items属性来排列和对齐不同形状的元素。
3536

被折叠的 条评论
为什么被折叠?



