<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>demo</title> <style> .container { width: 150px; display: flex; flex-direction: column; } .row { display: flex; flex-direction: row; } .cell { width: 100%; height: 50px; background: yellow; border-color: red; border-style: dashed; border-width: 2px; } </style> </head> <body> <div class="container"> <div class="row"> <div class="cell"></div> <div class="cell"></div> <div class="cell"></div> <div class="cell"></div> </div> <div class="row"> <div class="cell"></div> <div class="cell"></div> <div class="cell"></div> </div> <div class="row"> <div class="cell"></div> <div class="cell"></div> </div> </div> </body> </html>