難道是我還是在更改窗口大小時很早就開始? https://jsfiddle.net/t0o0capo/基本Twitter自舉網格故障
例如,我希望我的移動電話上的div具有背景黑色,但在桌面上是這種顏色。爲什麼是這樣?
/* Latest compiled and minified JavaScript included as External Resource */
/* Latest compiled and minified CSS included as External Resource*/
/* Optional theme */
@import url('//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css');
.col-lg-4 {
background:red
}
.col-md-4 {
background:green
}
.col-sm-4 {
background:blue
}
.col-xs-12 {
background:black;
}
body {
margin: 10px;
}
<link href="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-4 col-md-4 col-lg-2 thumb">
<a class="thumbnail" href="#">
<img class="img-responsive" src="http://placehold.it/400x300" alt="">
</a>
</div>
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12 thumb">
<a class="thumbnail" href="#">
<img class="img-responsive" src="http://placehold.it/400x300" alt="">
</a>
</div>
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12 thumb">
<a class="thumbnail" href="#">
<img class="img-responsive" src="http://placehold.it/400x300" alt="">
</a>
</div>
<hr>
<!-- Footer -->
<footer>
<div class="row">
<div class="col-lg-12">
<p>Copyright © Your Website 2014</p>
</div>
</div>
</footer>
</div>
謝謝科迪。是否有任何現有的標準媒體查詢Bootstrap 3我應該使用? – michaelmcgurk
@michaelmcgurk據我所知,Bootstrap使用「最小寬度」480,768,992和1200像素進行媒體查詢。 –