gpt4 book ai didi

css - 文本超出包含 div

转载 作者:行者123 更新时间:2023-11-28 09:04:27 25 4
gpt4 key购买 nike

我有这个codepen here ,文本到达 div 的右边界时不应该换行吗?

html:

<div class="test">

<p>dfsjiodjdfsjiodjdfsjiodjdfsjiodjdfsjiodjdfsjiodjdfsjiodjdfsjiodjdfsjiodjdfsjiodjdfsjiodjdfsjiodjdfsjiodjdfsjiodjdfsjiodjdfsjiodjdfsjiodjdfsjiodjdfsjiodjdfsjiodjdfsjiodjdfsjiodjdfsjiodjdfsjiodjdfsjiodjdfsjiodjdfsjiodjdfsjiodjdfsjiodjdfsjiodj</p>
</div>

CSS:

div.test{
width:400px;
height:800px;
border-style: solid;
border-color: red;
margin:1px; padding:1px;

}

最佳答案

使用word-wrap:break-word

div.test{
width:400px;
height:800px;
border-style: solid;
border-color: red;
margin:1px; padding:1px;
word-wrap:break-word;
}

关于css - 文本超出包含 div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25033382/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com