Is there a way to not break a word at a specific point?
Something like the opposite of ­
?
I've set my text to hyphens: auto;
but at a specific point the word breaks which is incorrect. I already set ­
at multiple spots in the word, but it still breaks at the wrong point.
I want to insert something in the html (no css or anything because it has to work editorial) that tells the browser to never break at this point no matter what.
AFAIK there's no explicit HTML special char to do this.
One workaround might be to specify your whole content to be breakable anywhere, and wrap the unbreakable parts of your word in a span
without word-break.
Then, you can decide in your editor where you'll want the word to stop:
.breakable {
word-break: break-all;
}
.unbreakable {
word-break: normal;
color: red;
}
<div class="breakable">Browser can break anywhere here, but not where I decide: on this <span class="unbreakable">specificsuperlong</span>wordofmine, the red part is unbreakable. </div>
<div class="breakable">If I want to decide a special position it can only split on, I wrap my special <span class="unbreakable">unbrea</span>k<span class="unbreakable">able</span> in two spans.</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With