由於我的標題說明我想垂直對齊我的btn,所以它是我的形象的中心。我沒有任何運氣,因爲我的btn坐在我的形象之下,而不是頂部。我嘗試了很多,但似乎沒有任何工作。我已經發布了我的HTML和CSS,所以也許有人可以指導我從哪裏開始。使用顯示器彎曲垂直對齊圖像頂部的自舉btn
HTML
<div class="row">
<div class="col-md-4">
<div class="imgAbout">
<img src="img/team/neil580x410.jpg" class="img-responsive" alt="Neil Elmouchi Bio">
<a class="btn btn-sm btn-primary" href="bios/teamBioNeil.html" role="button">View More</a>
</div>
<h1>Neil Elmouchi</h1>
<h3>Chairman & CEO<br>
Senior Wealth Advisor</h3>
</div>
</div>
CSS
#about img {
margin: 0 auto;
}
.imgAbout {
background: #d5d5d5;
text-align: center;
}
.imgAbout img {
opacity: 1;
transition: opacity .25s ease-in-out;
-moz-transition: opacity .25s ease-in-out;
-webkit-transition: opacity .25s ease-in-out;
}
.imgAbout img:hover {
opacity: 0.4;
}
你在找這樣的事情 - http://codepen.io/nagasai/pen/NAXQRG?editors=1111 –
嗯,我想的BTN是垂直居中位於img – user3786102
的頂部檢查此更新的codepen -http://codepen.io/nagasai/pen/groVwV?editors = 1111 –