所以目前我正在尝试让我的列具有相同的高度,因为它们每个都只是有点偏离。有没有办法用flexbox做到这一点?我对flexbox不太熟悉,所以如果您有任何建议请告诉我!谢谢!
#recentwork {
background-color: #1DA0A3;
margin-left: auto;
margin-right: auto;
text-align: center;
text-decoration: none;
}
#recentwork a{
text-decoration:none;
}
#recent{
padding:20px;
text-decoration: none;
}
#recentwork img {
padding: 20px;
width: 200px;
height: 200px;
}
.more{
text-decoration: none;
color:black;
}
.more:hover{
color:white;
}
.titles{
text-decoration:none;
font-size:20px;
color:black;
}
.parentdiv{
display:inline-block;
text-decoration: none;
}
@media only screen and (min-width: 760px) {
#recentwork img {
width: 300px;
height: 300px;
text-decoration:none;
}
}
.content{
width: 400px;
}

<section id="skills">
<div id="recentwork">
<h2 id="recent"> Most Recent Work</h2>
<div class="parentdiv">
<a href="http://4vector.com/thumb_data/v4l-125260.jpg" data-lightbox="website" data-title="">
<img src="http://4vector.com/thumb_data/v4l-125260.jpg" width="200px" height="200px">
<div class="underline">
<h3 class="titles"> Web Design</h3></div>
</a>
<p class="content">not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
<a href="" class="more"><h3 > See More</h3></a>
</div>
<div class="parentdiv">
<a href="http://4vector.com/thumb_data/v4l-125260.jpg" data-lightbox="website" data-title="">
<img src="http://4vector.com/thumb_data/v4l-125260.jpg" width="200px" height="200px">
<h3 class="titles"> Photography</h3>
</a>
<p class="content">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown </p>
<a href="" class="more"><h3 > See More</h3></a>
</div>
<div class="parentdiv">
<a href="http://4vector.com/thumb_data/v4l-125260.jpg" data-lightbox="website" data-title="">
<img src="http://4vector.com/thumb_data/v4l-125260.jpg" width="200px" height="200px">
<h3 class="titles"> Print</h3>
</a>
<p class="content">printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. </p>
<a href="" class="more"><h3 > See More</h3></a>
</div>
<div class="parentdiv">
<a href="http://4vector.com/thumb_data/v4l-125260.jpg" data-lightbox="website" data-title="">
<img src="http://4vector.com/thumb_data/v4l-125260.jpg" width="200px" height="200px">
<h3 class="titles"> Logos</h3>
</a>
<p class="content">printer took a galley of type and scrambled it to make a type specimen book. It has survived </p>
<a href="" class="more"><h3 > See More</h3></a>
</div>
</div>
</section>
&#13;
答案 0 :(得分:1)
首先在<h2 id="recent"> Most Recent Work</h2>
之外移动#recentwork
,以便您的展示项仅为.parentdiv
。
然后将display:flex
添加到#recentwork
。
这将使您的列具有相同的高度。
将flex:1
添加到.parentdiv
会使您的列宽度相等。
答案 1 :(得分:1)