<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
* {
box-sizing: border-box;
}
.column {
float: left;
width: 25%;
padding: 20px;
}
.row:after {
content: "";
display: table;
clear: both;
}
@media screen and (max-width: 992px) {
.column {
width: 50%;
}
}
@media screen and (max-width: 600px) {
.column {
width: 100%;
}
}
</style>
</head>
<body>
<h2>响应式四列布局</h2>
<p><strong>调整浏览器窗口大小以查看响应效果。</strong> 在宽度不超过 992 像素的屏幕上,列的大小将从四列调整为两列。 在宽度为 600 像素或更小的屏幕上,列将堆叠在一起,而不是彼此相邻。</p>
<div class="row">
<div class="column" style="background-color:#aaa;">