我有以下場景,如果超過框的寬度,我需要將整個單詞推到新行。我已經使用CSS3 自動換行屬性來實現這一點。但它打破瞭如下所示的單詞。用CSS將新單詞推到新行
我想不會打破字,推動整個單詞到下一行文本是否爲多。
HTML
<div class="container">
<div class="img-container">
<img class="img-icon" src="/icons/image1.png">
</div>
<p class="icon-footer">Performance Validator</p>
</div>
CSS
.container {
position: absolute;
align-items: flex-start;
text-align: center;
box-sizing: border-box;
outline: 0;
display: flex;
flex-direction: column;
}
.container img-container {
display: flex;
}
.container .img-container .img-icon {
border:1px solid #000;
height: 64px;
width: 64px;
outline: 0;
}
.icon-footer {
margin: 0;
width: 64px;
color: #000;
font-size: 13px;
white-space: normal;
line-height: 1.5;
word-wrap: break-word;
}
刪除自動換行 –