How to break word after special character like Hyphens (-)

后端 未结 11 2033
南方客
南方客 2020-12-04 17:31

Given a relatively simple CSS:

11条回答
  •  爱一瞬间的悲伤
    2020-12-04 17:52

    Depending on what you want to see exactly, you can use a combination of hyphen, soft hyphen, and/or zero width space.

    On a soft hyphen, your browser can word-break (adding an hyphen). On a zero width space, your browser can word break (without adding anything).

    Thus, if your code is something like :

    111111­222222­-333333​444444-​555555

    then your browser will show this with no word-break :

    1111112222222-33333334444444-5555555

    and this will every possible word-break :

    111111-
    222222-
    -333333
    444444-
    555555

    Just pick up the option you need. In your case, it may be the one between 4s and 5s.

提交回复
热议问题