弹性布局案例---骰子5
代码:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <style type="text/css"> *{ padding: 0; margin: 0;; } #contenier{ display: flex; flex-direction: column; justify-content: stretch; align-items: center; height: 1000px; } .box1{ display: flex; flex-direction: row; flex-grow: 1; justify-content: space-around; align-items: center; width: 100%; } .box2{ border-radius: 200%; width: 30%; height: 80%; background-color: red; border: 1px solid #000000; } </style> </head> <body> <div id="contenier"> <div class="box1"> <div class="box2"></div> <div class="box2"></div> </div> <div class="box1"> <div class="box2"></div> </div> <div class="box1"> <div class="box2"></div> <div class="box2"></div> </div> </div> </body> </html>
效果图:

本文来自博客园,作者:坤k,转载请注明原文链接:https://www.cnblogs.com/fukunwang/p/15642352.html

浙公网安备 33010602011771号