求解答?
这是想实现的效果
这是现在的效果
代码
<div>
<div>
<div class="ceshi">
<img src="https://img.alicdn.com/imgextra/i3/2206481004341/O1CN01fZyp821hwE2GKA8z2_!!0-item_pic.jpg_430x430q90.jpg" alt="">
<p>
<strong>这是一段文字</strong>
</p>
</div>
<div class="ceshi">
<img src="https://img.alicdn.com/imgextra/i3/2206481004341/O1CN01fZyp821hwE2GKA8z2_!!0-item_pic.jpg_430x430q90.jpg" alt="">
<p>
<strong>这是一段有点长的有点长长长才是是是是文字</strong>
</p>
</div>
</div>
</div>
.ceshi{
display: inline-block;
border-width: 1px;
border-style: solid;
border-radius: 4px;
box-sizing: border-box;
margin-right: 6px;
margin-bottom: 4px;
white-space: nowrap;
font-size: 12px;
border-color: #E02020!important;
width: 200px;
}
img{
border-color: #E02020!important;
max-width: 100%;
}
p{
text-align: center; word-wrap: break-word; word-break: break-all; white-space: normal;
}