代码
提交代码
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <style> .demo{ display:flex; flex-direction:column; text-align: center; line-height: 100px; } .item{ background:#ccc; height:100px; border-bottom:1px solid #fff; } </style> </head> <body> <div class="demo"> <div class="item">1</div> <div class="item">2</div> <div class="item">3</div> </div> </body> </html>
运行结果