gpt4 book ai didi

html - 使用 CSS Hyphens Auto 停止断词

转载 作者:行者123 更新时间:2023-11-28 01:39:22 25 4
gpt4 key购买 nike

我有一个网站,我在其中使用 hyphens: auto 函数来分隔较长的单词。一切正常,但在某些地方它会破坏不应该破坏的单词。例如团队成员的姓名。我怎样才能保持连字符的功能,但排除一些单词被破坏?因为它只发生在很少的几个词上,所以我可以分别编辑每个词。

有什么建议吗?

谢谢!

最佳答案

由于没有代码示例,我假设我理解正确。

我认为将这些词放入相应样式的范围内应该可以解决问题。

<div>
<p>
very long paragraph which doesn't end Edgar <span>TestingnamesonIdont'tknowwhatcanmakethispossiblyanylongerthanthiswhichIamdoingrightnow.</span>
very long paragraph which doesn't end Edgar <span>TestingnamesonIdont'tknowwhatcanmakethispossiblyanylongerthanthiswhichIamdoingrightnow.</span>
very long paragraph which doesn't end Edgar <span>TestingnamesonIdont'tknowwhatcanmakethispossiblyanylongerthanthiswhichIamdoingrightnow.</span>
very long paragraph which doesn't end Edgar <span>TestingnamesonIdont'tknowwhatcanmakethispossiblyanylongerthanthiswhichIamdoingrightnow.</span>
very long paragraph which doesn't end Edgar <span>TestingnamesonIdont'tknowwhatcanmakethispossiblyanylongerthanthiswhichIamdoingrightnow.</span>
very long paragraph which doesn't end Edgar <span>TestingnamesonIdont'tknowwhatcanmakethispossiblyanylongerthanthiswhichIamdoingrightnow.</span>
very long paragraph which doesn't end Edgar <span>TestingnamesonIdont'tknowwhatcanmakethispossiblyanylongerthanthiswhichIamdoingrightnow.</span>
very long paragraph which doesn't end Edgar <span>TestingnamesonIdont'tknowwhatcanmakethispossiblyanylongerthanthiswhichIamdoingrightnow.</span>
very long paragraph which doesn't end Edgar <span>TestingnamesonIdont'tknowwhatcanmakethispossiblyanylongerthanthiswhichIamdoingrightnow.</span>
very long paragraph which doesn't end Edgar <span>TestingnamesonIdont'tknowwhatcanmakethispossiblyanylongerthanthiswhichIamdoingrightnow.</span>
very long paragraph which doesn't end Edgar <span>TestingnamesonIdont'tknowwhatcanmakethispossiblyanylongerthanthiswhichIamdoingrightnow.</span>
very long paragraph which doesn't end Edgar <span>TestingnamesonIdont'tknowwhatcanmakethispossiblyanylongerthanthiswhichIamdoingrightnow.</span>

</p>
</div>

p{
overflow-wrap: break-word;
word-wrap: break-word;


-ms-hyphens: auto;
-moz-hyphens: auto;
-webkit-hyphens: auto;
hyphens: auto;
}

p span{

overflow-wrap: normal;
word-wrap: normal;
-ms-hyphens: none;
-moz-hyphens: none;
-webkit-hyphens: none;
hyphens: none;
}

希望这对您有所帮助!

关于html - 使用 CSS Hyphens Auto 停止断词,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50507859/

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