Continuing with typography features, we now enter the word
and paragraph
properties.
Let's get going.
The
hyphens
CSS property tells the browser how to handle hyphenation when text lines wrap, and it looks like this:
hyphens: auto;
We can control when to hyphenate and whether to allow it or let it happen under certain conditions.
Hyphenation is language dependent. The language in a document is defined by the lang
attribute; browsers will hyphenate if they support the language and a proper hyphenation dictionary is available. Each browser supports hyphenation differently.
Tip
Ensure that the lang
attribute is declared either globally on the <html>
tag or on the specific element whose content should be hyphenated.
This property supports three keyword values: none
, manual
, and auto
.
none
: Text lines are not broken at line breaks even if there are characters suggesting where a line break should be introduced. Lines will only break on whitespace.manual
:...