我正在爲我的網站構建一個「團隊」部分,其中與成員img
和成員頭部相同的列包含的member_body
div滑落,如果我想定義他們的寬度。在這種情況下可能會出現什麼問題?我希望他們垂直對齊,並有相同的寬度。同一列中的div不會垂直對齊
.member {
padding: 30px;
text-align: center;
position: relative;
}
.member img {
max-width: 250px;
margin: 20px auto 0px auto;
}
.member h3 {
margin: 30px 0px;
}
.member_body {
border: 1px solid red;
max-width: 250px;
overflow: hidden;
height: 200px;
}
.member_body span {
margin-top: 20px;
font-size: 30px;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<div id="team">
<h1>Our Team</h1>
<div class="separator2"></div>
<div class="container-fluid">
<div class="row">
<div class=" col-md-6">
<div class="member">
<h3>Member One</h3>
<img src="photos/team-member-1.jpg" alt="Team Member 1">
<div class="member_body">
<h5>Position</h5>
<div class="separator"></div>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</br>Voluptates praesentium nulla cupiditate!</p>
<span class="glyphicon glyphicon-envelope" aria-hidden="true"></span>
</div>
</div>
</div>
<div class=" col-md-5">
<div class="member">
<h3>Member 2</h3>
<img src="photos/team-member-2.jpg" alt="Team Member 2">
<div class="member_body">
<h5>Position</h5>
<div class="separator"></div>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</br>Voluptates praesentium nulla cupiditate!</p>
<span class="glyphicon glyphicon-envelope" aria-hidden="true"></span>
</div>
</div>
</div>
<div class="col-md-1"></div>
</div>
</div>
</div>
`
保證金:20px的汽車?在member_body類? – Pushpendra