我想我会尝试一下 twitter bootstrap,然后我想出了以下布局。
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="css/bootstrap-responsive.css" rel="stylesheet">
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<title></title>
</head>
<body>
<div id="header" class="container">
<div class="row">
<div class="span1" style="background-color: yellow; height:50px;">
</div>
<div class="span1" style="background-color: yellow; height:50px;">
</div>
<div class="span1" style="background-color: yellow; height:50px;">
</div>
<div class="span1" style="background-color: yellow; height:50px;">
</div>
<div class="span1" style="background-color: yellow; height:50px;">
</div>
<div class="span1" style="background-color: yellow; height:50px;">
</div>
<div class="span1" style="background-color: yellow; height:50px;">
</div>
<div class="span1" style="background-color: yellow; height:50px;">
</div>
<div class="span1" style="background-color: yellow; height:50px;">
</div>
<div class="span1" style="background-color: yellow; height:50px;">
</div>
<div class="span1" style="background-color: yellow; height:50px;">
</div>
<div class="span1" style="background-color: yellow; height:50px;">
</div>
</div>
</div>
<div id="main" class="container">
<div class="row">
<div class="span3" style="background-color: red; height:100px;">
</div>
<div class="span9" style="background-color: blue; height:100px;">
<div class="row">
<div class="span3" style="background-color: orange; height:50px;">
</div>
<div class="span3" style="background-color: orange; height:50px;">
</div>
<div class="span3" style="background-color: orange; height:50px;">
</div>
</div>
</div>
</div>
</div>
<div id="footer" class="container">
<div class="row">
<div class="span12" style="background-color: green; height:50px;">
</div>
</div>
</div>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>
从我读过的内容来看,一旦视口宽度小于 767px,列应该堆叠。我无法让它在 Chrome 中工作。