While I may not have a deep understanding of the hyphens
CSS property, it appears that specifying the language in the DOM using lang=
is crucial for its functionality. For instance, adding
<html lang="en">...</html>
will enable you to utilize
hyphens
throughout the document.
In the case of your CodePen example, CodePen automatically includes the lang="en"
attribute to the <html>
element.
However, it seems that Chrome (in contrast to Firefox) disregards the lang="en"
declaration when encountering the all: unset;
property on the HTML element, particularly for hyphenation purposes.
To verify this, consider adding the lang
attribute directly to the div and applying all: unset;
solely to that div, then removing it afterwards.
A simple solution could involve adjusting your CSS reset selector to target html *
instead of *
, essentially encompassing everything within the <html>
tags excluding the <html>
tag itself. If acceptable, you may implement the following:
html * {
all: unset;
display: revert;
}
Check out a comprehensive example on CodePen.