我使用自舉井做出一種需要從左到右(水平)的卡顯示類型,但由於某些原因井只需要垂直對齊。水平對齊自舉井
body {
background-color: #5C67B6;
}
html,
body {
height: 100%;
padding-top: 70px;
}
.btn-purple {
color: #fff;
background-color: #5C67B6;
border-color: #5C67B6;
/*set the color you want here*/
}
.btn-purple:hover,
.btn-purple:focus,
.btn-purple:active,
.btn-purple.active,
.open>.dropdown-toggle.btn-purple {
color: #fff;
background-color: #4b5496;
border-color: #4b5496;
/*set the color you want here*/
}
.container {
display: inline-block;
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<body>
<div class="container content-sm">
<div class="row">
<div class="col-md-4 col-sm-8">
<div class="well">
<img class="center-block" src="https://upload.wikimedia.org/wikipedia/en/thumb/9/9f/Twitter_bird_logo_2012.svg/1259px-Twitter_bird_logo_2012.svg.png" style="border-radius: 50%;" height="80" width="80">
<h3 style="text-align: center;">Test!</h3>
<p>The quick brown fox jumped over the lazy brown dog</p>
<a href="#" class="btn btn-purple btn-sm"><i class="fa fa-sign-in" aria-hidden="true"></i> Join server!</a>
</div>
<div class="well">
<img class="center-block" src="https://upload.wikimedia.org/wikipedia/en/thumb/9/9f/Twitter_bird_logo_2012.svg/1259px-Twitter_bird_logo_2012.svg.png" style="border-radius: 50%;" height="80" width="80">
<h3 style="text-align: center;">Test!</h3>
<p>The quick brown fox jumped over the lazy brown dog</p>
<a href="#" class="btn btn-purple btn-sm"><i class="fa fa-sign-in" aria-hidden="true"></i> Join server!</a>
</div>
<div class="well">
<img class="center-block" src="https://upload.wikimedia.org/wikipedia/en/thumb/9/9f/Twitter_bird_logo_2012.svg/1259px-Twitter_bird_logo_2012.svg.png" style="border-radius: 50%;" height="80" width="80">
<h3 style="text-align: center;">Test!</h3>
<p>The quick brown fox jumped over the lazy brown dog</p>
<a href="#" class="btn btn-purple btn-sm"><i class="fa fa-sign-in" aria-hidden="true"></i> Join server!</a>
</div>
</div>
</div>
</div>
</body>
如果您檢查片段中,你會發現這一切都被垂直放置的各個單獨的孔被放置在後。我使用inline-block的用於容器,並試圖使用它沒有運氣的井。我怎樣才能讓它水平對齊?
所以你想要檢測的孔,而不是對彼此的頂部並排側,? – Nieminen
@Nieminen是的。我被告知使用內聯塊來實現這個不工作。 – Zezima
你們每口井的寬度都一樣嗎? – Nieminen