<!DOCTYPE html>
<html>
<head>
<style>
.box {
width: 200px;
height: 200px;
padding: 20px;
display: flex;
flex-direction: row;
justify-content: space-between;
border: 2px solid #ccc;
border-radius: 10px;
}
.item {
width: 40px;
height: 40px;
border-radius: 50%;
background-color: #666;
}
.item:nth-child(2) {
align-self: center;
}
.item:nth-child(3) {
align-self: flex-end;
}
</style>
</head>
<body>
<div class="box">
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div>
</body>
</html>
https://blog.youkuaiyun.com/weixin_43837268/article/details/90812483
本文介绍了一个使用CSS flexbox实现特定布局的例子。通过定义一个包含三个圆形元素的盒子,并利用flex属性来调整这些元素的位置,展示了如何使元素在水平方向上均匀分布、居中对齐及底部对齐。
914

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



