【发布时间】:2020-12-31 17:48:27
【问题描述】:
我的文本有问题,我需要将文本和货币部分分开,并且还必须以这样的方式对齐文本,以便每当我以较小的文本查看货币部分到下一行时
.adventure-card {
display:flex;
flex-wrap: wrap;
width: 100%;
height:auto;
justify-content:center;
align-items: center;
border-radius: 10px 10px 10px 10px;
position:relative;
line-height: 1.7;
}
.adventure-card img {
/* TODO: MODULE_ADVENTURES_GRID */
/* 1. Fill in the required properties. */
width: 100%;
height: 25vh;
border-radius: 10px 10px 0px 0px;
}
<div class="container">
<div class="content">
<!-- TODO: MODULE_ADVENTURES_GRID -->
<!-- 1. Create the grid of adventures by adding child elements as required. -->
<div class = "row">
<div class="col-6 col-sm-6 col-lg-3 mb-4 d-flex align-items-stretch px-md-4">
<a href = "resort/index.html">
<div class = "adventure-card border bg-light">
<div class = "adventure-card img-responsive">
<img src ="/assets/adventures/resort.jpg" alt = "tower.jpg">
</div>
<p>Resort</p>
<p>₹1,200 </p>
</div>
</a>
</div>
</div>
<div class="col-6 col-sm-6 col-lg-3 mb-4 d-flex align-items-stretch px-md-4">
<div class = "adventure-card border bg-light">
<div class = "adventure-card img-responsive">
<img src ="/assets/adventures/mount.jpg" alt = "Skiing.jpg">
</div>
<p> Skiing</p>
<p>₹1,900 </p>
</div>
</div>
</div>
<div class = "row">
<div class="col-6 col-sm-6 col-lg-3 mb-4 d-flex align-items-stretch px-md-4">
<div class = "adventure-card border bg-light">
<div class = "adventure-card img-responsive">
<img src ="/assets/adventures/canopy.jpg" alt = "tower.jpg">
</div>
<p>Canopy</p>
<p>₹1,800 </p>
</div>
</div>
<div class="col-6 col-sm-6 col-lg-3 mb-4 d-flex align-items-stretch px-md-4">
<div class = "adventure-card border bg-light">
<div class = "adventure-card img-responsive">
<img src ="/assets/adventures/beachside.jpg" alt = "canopy.jpg">
</div>
<p mb-0>Beach Getaway</p>
<p>₹2,200 </p>
</div>
</div>
</div>
</div>
</div>
谁能帮帮我? text 和 money 部分居中,符合预期,但无法分隔 text 和 money 部分
【问题讨论】:
标签: html css bootstrap-4