Best practice for forcing text to wrap onto new line on a specific word
Currently I'm trying to wrap text onto 3 lines. I want the text to wrap on a specific word. My current solution is using <br/> elements but I read that is not a good practice and is bad for screen readers. How do I force line breaks on a specific word without affecting accessibility?
3 Replies
Ok so I have two solutions which both work. But from what I'm reading, the divs would also be bad for screen readers but I don't know about the spans.
i present to you:
<wbr>
throw some of those bad boys where you want to wrap where there isn't enough space, and the magic happens
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/wbr
if you need to break in the middle of a word, use ­
Awesome, I'll check it out. Thank you