我以为我会试试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中运行。
答案 0 :(得分:3)
我明白了。我只需要改变样式表的顺序。
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/bootstrap-responsive.css" rel="stylesheet">
答案 1 :(得分:0)
是的。您必须在引导文件
之后包含自定义CSS文件