我有一個三角形寬的Bootstrap網格,如下所示。Bootstrap網格不是以平板設備爲中心 - 響應式設計
我有塌陷到手機上的一列布局。
我希望它維持寬幅三廣場在平板電腦上,而是,它似乎是這樣的,它似乎要推到左邊,而不是居中。
我的代碼如下。我究竟做錯了什麼?我試過包括col-sm
的代碼,但它似乎沒有工作。
.worksquare {
background-color: black;
height: 200px;
border: 1px solid #C0C0C0;
}
.work-description {
color: #303030;
padding: 10px 8px;
}
<script src="https://use.fontawesome.com/8c321ca885.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Droid+Serif:400,700">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:400,700">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<body>
<div class="container-fluid">
<!-- full container -->
<div class="row" style="margin-top: 100px;"></div>
<!-- some header here -->
<!-- end of header section -->
<div class="row">
<div class="col-xs-0 col-sm-0 col-md-3"></div>
<div class="col-xs-12 col-sm-3 col-md-2 bottom-buffer30">
<a href="#" class="work-link">
<div class="worksquare"></div>
<div class="lato work-description"><b>Block title</b></a>:
<br />Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</div>
</div>
<div class="col-xs-12 col-sm-3 col-md-2 bottom-buffer30">
<a href="#" class="work-link">
<div class="worksquare"></div>
<div class="lato work-description"><b>Block title</b></a>:
<br />Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</div>
</div>
<div class="col-xs-12 col-sm-3 col-md-2 bottom-buffer30">
<a href="#" class="work-link">
<div class="worksquare"></div>
<div class="lato work-description"><b>Block title</b></a>:
<br />Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</div>
</div>
<div class="col-xs-0 col-sm-0 col-md-3"></div>
</div>
<div class="row">
<div class="col-xs-0 col-sm-0 col-md-3"></div>
<div class="col-xs-12 col-sm-3 col-md-2 bottom-buffer30">
<a href="#" class="work-link">
<div class="worksquare"></div>
<div class="lato work-description"><b>Block title</b></a>:
<br />Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</div>
</div>
<div class="col-xs-12 col-sm-3 col-md-2 bottom-buffer30">
<a href="#" class="work-link">
<div class="worksquare"></div>
<div class="lato work-description"><b>Block title</b></a>:
<br />Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</div>
</div>
<div class="col-xs-12 col-sm-3 col-md-2 bottom-buffer30">
<a href="#" class="work-link">
<div class="worksquare"></div>
<div class="lato work-description"><b>Block title</b></a>:
<br />Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</div>
</div>
<div class="col-xs-0 col-sm-0 col-md-3"></div>
</div>
<div class="row top-buffer40"></div>
</div>
</body>
</html>
這對我有效。謝謝! – noblerare