多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
>[danger]css完成如下效果 ---- ![](https://img.kancloud.cn/f5/b9/f5b978c470ee4e6d3e99180abe57dcfa_395x405.png) >[warning]弹性布局 --- ~~~ <style> .father{ border: 1px solid black; width: 300px; height: 300px; display: flex; flex-direction: column; } .father div{ width: 100px; height: 100px; background-color: blue; } .my_1{ align-self:center; /*纵轴方向对齐方式, 会受flex-direction影响*/ } .my_2{ align-self:flex-start; } .my_3{ align-self:flex-end; } </style> <div class="father"> <div class="my_1"></div> <div class="my_2"></div> <div class="my_3"></div> </div> ~~~ >[warning]网格布局 --- ~~~ <style> .container{ display: grid; grid-template-columns: auto auto auto; grid-template-rows: auto auto auto; grid-template-areas: ". center ." "left . ." ". . right"; width: 300px; height: 300px; border: 1px solid black; } .container div{ width: 100px; height: 100px; background-color: blue; } .item-1{ grid-area: center; } .item-2{ grid-area: left; } .item-3{ grid-area: right; } </style> <div class="container"> <div class="item-1"></div> <div class="item-2"></div> <div class="item-3"></div> </div> ~~~