Open loket opened 4 years ago
This technique might be useful: https://stackoverflow.com/a/37132903
This actually looks very simple. It can be solved by adding a "soft hyphen" (a ­
) in between words, and by setting hyphens: manual;
in the CSS.
Right now, the combined word is actually an ordered list, but I assume it will need to be a header or something for this to work. But that's probably a good idea anyway.
Here's a demo of the hyphenation in action: https://jsitor.com/aZ-THYoih
Edit: Updated example with links. It works if ­
is part of the link - but it breaks capitalization in CSS. Fixed by using the :first-letter
pseudo-element.
If two words are really long, they will overflow on the screen. It would be better if they would dynamically "split" and shown on the line below.
For instance: If the word "blemmegarnityr" is too long for the screen, it should be shown like this:
Splitting the content should be possible with
display: inline-block
, but I'm not sure if it's possible to transform the text (add the hyphen) easily.