The shy hyphenation

Do you know this? Viewing your website on desktop devices and tablets is great fun, but on mobile devices (smartphones) long words simply break somewhere when the screen width is no longer sufficient.

The reason is that the browser simply does not know where to break according to the grammar rules. But a soft hyphen placed in the right place in long words does exactly that.

Table of Contents

What it's all about

Without soft separator

Ohne Silbentrennung

With soft separator

Mit Silbentrennung

How to use the soft hyphen for hyphenation

The problem is that the character is invisible and you won't find it on your keyboard.

HTML special characters

The soft separator is also available as a special HTML character. It reads:

­

Or alternatively:

­

But you cannot simply use this in text or heading blocks in a WordPress editor. This code is not interpreted, but is output on the page in exactly the same way:

Table of contents

resp.

Contents­directory

WordPress can be merciless, so that's not a solution.

Alternatively, you can of course output your headings in an HTML block, in which case the drawing would appear invisible in the background.

<h2>Table of contents</h2>
<h2>Table of contents</h2>

However, you would have to struggle with HTML instructions, and those days should slowly be over.

Copying an invisible sign

So the trick is to somehow get the character into the computer's cache so that you can place it in the right place, in this case between the parts of the word Contents and directory can be used.

You can obtain this invisible sign here, for example: https://unicode-explorer.com/c/00AD

You will not see a character under "Copy", but click on the button anyway. Then search for the long word in your website and insert the character where hyphenation is grammatically correct.

Danube steamship electricity main works construction sub-officer company

Yes, just test immediately by looking at this long word on the page on your smartphone, or narrow the browser window.

Have fun.

Wrapping with CSS

If you are not afraid of using CSS instructions, you can also use them.

h1, h2, h3, h4, h5, h6, p, li {
  word-break: break-word;
  -webkit-hyphens: auto;
  -moz-hyphens: auto;
  -ms-hyphens: auto;
  -o-hyphens: auto;
  hyphens: auto;
}

In this case, soft wrapping would automatically occur for all headings, paragraphs and texts in lists.

If your browser feels like it.

For the recommendation:

Would you like to be informed quickly about new articles and more?

Then we recommend that you subscribe to our newsletter "Online Marketing News from E-Werkstatt".


Heinz Duschanek
Heinz Duschanek

Heinz Duschanek founded the online marketing agency E-Werkstatt in 2003. Having previously worked in radio (Radio CD International, Ö1, Ö3), he is now particularly pleased with the direction that online marketing is taking. This gives him an excuse to buy lots of electrical devices and gadgets for audio and video.

Heinz is also interested in Tango Argentino (since 2009), Lindy Hop, Wing-Tsun, boxing and (jazz/blues) guitar.

One comment

Leave a Reply

Your email address will not be published. Required fields are marked *