我很困惑與display:flex
是如何得到響應圖像電網這樣的..提前如何做正確的響應和圖像網格視圖與顯示:彎曲
感謝。我已經嘗試了許多StackOverflow的答案,但它並沒有工作
現在我有佈局是這樣的...
HTML代碼:
<div class="makeExploreCenter">
<div class="explorePost">
<img src="skyline-buildings-new-york-skyscrapers.jpg" />
<div class="likesdetails">
<div class="propicthumnail">
</div>
</div>
</div>
<div class="explorePost">
<img src="url.jpg" />
<div class="likesdetails">
<div class="propicthumnail">
</div>
</div>
</div>
<div class="explorePost">
<img src="ymbpp1l.jpg" />
<div class="likesdetails">
<div class="propicthumnail">
</div>
</div>
</div>
<div class="explorePost">
<img src="skyline-buildings-new-york-skyscrapers.jpg" />
<div class="likesdetails">
<div class="propicthumnail">
</div>
</div>
</div>
<div class="explorePost">
<img src="url.jpg" />
<div class="likesdetails">
<div class="propicthumnail">
</div>
</div>
</div>
<div class="explorePost">
<img src="ymbpp1l.jpg" />
<div class="likesdetails">
<div class="propicthumnail">
</div>
</div>
</div>
</div>
CSS代碼
.makeExploreCenter{
width: 90%;
margin: 0 auto;
display: flex;
flex-wrap:wrap ;
justify-content: center; /* align horizontal */
align-items: center; /* align vertical */
}
.explorePost{
text-align: center;
margin: 5px;
max-width: 300px;
min-width: 300px;
align-self: flex-start;
background: #545454;
}
.explorePost img{
max-height: 60vh;
max-width: 100%;
max-height: 70vh;
}
.likesdetails{
width: 100%;
height: 44px;
background: #FAFAFA;
margin-top: -3px;
overflow: auto;
overflow: hidden;
display: flex;
}
沒有@NingJi我想學習這些東西.... – Nane
的http:// codepen。 io/githubitsme/pen/NbarmP/ – Nane