使用CSS Hyphens Auto打开单词

时间:2018-05-24 11:10:34

标签: html css wordpress web

我有一个网站,我使用连字符:自动功能来打破更长的单词。这一切都很好,但在某些地方,它打破了不应该打破的话。例如团队成员的名称。我怎样才能保持连字符功能,但是不要破坏某些单词? 因为它只发生在很少的单词上,我可以单独编辑每个单词。

有什么建议吗?

谢谢!

1 个答案:

答案 0 :(得分:0)

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

我认为将这些单词放入你相应调整的范围内应该可以解决问题。

<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;
}

希望这有帮助!