代码示例:(标识:cssref_flex-direction_responsive)
<!DOCTYPE html>
<html>
<head>
<style>
* {
  box-sizing: border-box;
}

.flex-container {
  display: flex;
  flex-direction: row;
  font-size: 30px;
  text-align: center;
}

.flex-item-left {
  background-color: #f1f1f1;
  padding: 10px;
  flex: 50%;
}

.flex-item-right {
  background-color: dodgerblue;
  padding: 10px;
  flex: 50%;
}

/* 响应式布局 - 制作一列布局而不是两列布局 */
@media (max-width: 800px) {
  .flex-container {
    flex-direction: column;
  }
}
</style>
</head>
<body>

<h1>响应式弹性框</h1>

<p>"flex-direction: row;" 水平地并排弹性项目(从左到右)。</p>
<p>"flex-direction: column;" 垂直地堆叠弹性项目(从上到下)。</p>
<p><b>请调整浏览器窗口的大小,来查看小于或等于 800 像素时的方向改变。</b></p>

<div class="flex-container">
  <div class="flex-item-left">1</div>
  <div class="flex-item-right">2</div>
</div>

</body>
</html>
运行结果: