我的布局工作正常,直到for collectors
div 换行。此时,后续的what artists are saying
div 不会被推到被包裹的内容之下。有谁知道为什么?
我尝试将align-content
“收藏家”弹性框设置为各种设置。
PS 使用 Tailwind.css
显示元素未包装的时间
未包装:
显示元素何时被包裹
包装时:
HTML
<!-- for artist-for collectors -->
<div class="for-artists-and-collectors flex flex-wrap">
<div class="flex justify-start h-full bg-red">
<div class="for-container flex flex-col justify-center w-full h-full bg-black px-8">
<h2 class="text-white pb-2">For Artists</h2>
<div class="text-sm text-white text-left pb-4">
I want to auction my artwork using K****o
</div>
<k-button style="height: 40px;">Create Account -></k-button>
</div>
<div class="for-artists-bg h-full flex-grow flex-shrink"></div>
</div>
<div class="flex justify-start h-full bg-green">
<div class="for-container flex flex-col justify-center w-full h-full bg-gray px-8">
<h2 class="text-white pb-2">For Collectors</h2>
<div class="text-sm text-white text-left pb-4">
I want to discover & bid on original artwork
</div>
<k-button style="height: 40px;">Browse Auctions -></k-button>
</div>
<div class="for-collectors-bg h-full flex-grow flex-shrink"></div>
</div>
</div>
<!-- /for artist-for collectors -->
<!-- what artists are saying -->
<div class="flex content-between">
<div class="waas flex flex-col items-end">
<h2 class="text-black waas-title text-right mb-6">
What artists are saying
</h2>
<div class="waas-controls flex">
<k-button
style="height: 40px; width: 40px;"
color="white"
class="mr-2">
<left-arrow-black />
</k-button>
<k-button style="height: 40px; width: 40px;">
<left-arrow-white class="right-arrow" />
</k-button>
</div>
</div>
<div class="artist-profile">
</div>
</div>
风格
.for-artists-and-collectors {
height: 220px;
}
.for-artists-and-collectors > div {
flex: 1 1 50%;
min-width: 300px;
}
.for-artists-bg {
background-image: url("https://images.unsplash.com/photo-1482245294234-b3f2f8d5f1a4?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=80");
background-position: center center;
}
.for-collectors-bg {
background-image: url("https://images.unsplash.com/photo-1536574753884-8c45a0431ecf?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=80");
background-position: center center;
}
.for-container {
max-width: 220px;
}