This question has already been answered:

How to prohibit hyphenation?
Let's say

some text wi-fi 

if the block is narrow, how to prevent the transfer of fi to another line?

Reported as a duplicate by Grundy participants, aleksandr barakin , Nick Volynkin Jul 7 '17 at 2:12 .

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

  • Comments are not intended for extended discussion; conversation moved to chat . - Nick Volynkin

1 answer 1

Use instead of the usual hyphen the inextricable ‑ - with normal encoding (utf8), you can simply write it as a symbol in the text :

 p { font-family: monospace; width: 15ch; border: 1px dotted red; float: left; margin: 8px; } 
 <p>wi-fi wi-fi wi-fi wi-fi wi-fi wi-fi wi-fi wi-fi wi-fi wi-fi <p>wi&#8209;fi wi&#8209;fi wi&#8209;fi wi&#8209;fi wi&#8209;fi wi&#8209;fi wi&#8209;fi wi&#8209;fi wi&#8209;fi wi&#8209;fi <p>wi‑fi wi‑fi wi‑fi wi‑fi wi‑fi wi‑fi wi‑fi wi‑fi wi‑fi wi‑fi