<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>响应式布局</title> <style> body { font-family: sans-serif; } .container { display: flex; flex-direction: row; justify-content: space-around; align-items: center; } .column { width: 25%; padding: 20px; background-color: #ccc; } @media screen and (max-width: 768px) { .container { flex-direction: column; } } </style> </head> <body> <div class="container"> <div class="column">内容 1</div> <div class="column">内容 2</div> <div class="column">内容 3</div> <div class="column">内容 4</div> </div> </body> </html>