gpt4 book ai didi

html - 自动换行 : break-word does not work with a very long word combined with width: 100%

转载 作者:可可西里 更新时间:2023-11-01 13:00:42 25 4
gpt4 key购买 nike

为什么在这个 fiddle 里 https://jsfiddle.net/0h1wbju0/我的 word-wrap: break word and width: 100% 没有被尊重,长词没有被分解成多行以适应它的父 div?谢谢!

HTML:

    <div class="first_div">
<fieldset class="fieldset_description"><label>Description</label>
<div data-id="description"> fdsjalllffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff</div>
</fieldset>
</div>

CSS:

.first_div {
width: 200px;
}

.fieldset_description {
max-width: 100%;
word-wrap: break-word;
}

.description {
max-width: 100%;
word-wrap: break-word;
}

最佳答案

你应该使用=>

`word-break: break-all;`

Working code jsfiddle

关于html - 自动换行 : break-word does not work with a very long word combined with width: 100%,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40158951/

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