gpt4 book ai didi

html - 在 div 标签中显示长文本

转载 作者:太空宇宙 更新时间:2023-11-03 20:20:59 27 4
gpt4 key购买 nike

如果我在 div 中写长文本,那么长文本会超过 div 墙。如何将其显示为多行?

下面是我的测试代码

<html>
<body>
<div style="left: 700px; top: 150px; width: 400px; height: 360px; border:1px solid">1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890</div>
</body>
</html>

最佳答案

使用 CSS word-wrap 属性:

div {
word-wrap: break-word;
}

关于html - 在 div 标签中显示长文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10508472/

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