Search notes:

HTML element: wbr

<wbr> marks a position with a word break opportunity. A (HTML rendering) web browser might choose to break the word at the given position and start a new line with the reminder of the word. Thus, it is possible to render text content within confines whose width is too small for a word to be printed in its entirity.
When <wbr> kicks in, the word is just broken without using a hyphen to indicate the word break.
In order to also add a hyphen, the &shy; (= soft hyphen) entity is needed.
This is demonstrated with the following HTML fragment:
<!DOCTYPE html>
<html>
<head>
  <meta content="text/html;charset=utf-8" http-equiv="Content-Type">
  <title>Comparison of &lt;wbr&gt; and &amp;shy;</title>
</head>
<body>

  <div style='width:125px;background-color:#ffe;border:1px solid black'>
     Is a sentence necessarily incomprehensible if it contains long words?
    <p>
     Is a sentence nec<wbr>es<wbr>sa<wbr>rily in<wbr>com<wbr>pre<wbr>hen<wbr>si<wbr>ble if it contains long words?
    <p>
     Is a sentence nec&shy;es&shy;sa&shy;rily in&shy;com&shy;pre&shy;hen&shy;si&shy;ble if it contains long words?
  </div>

</body>
</html>
Github repository about-html, path: /tags/wbr/compare-with-shy.html
This HTML piece produces:

See also

HTML elements

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758206761, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/web/HTML/tags/wbr(67): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78