Dan Powell

Dan Powell

← Back to home
Preview of Pseudo Element Gambling Hover
View on CodePen ↗

Pseudo Element Gambling Hover


Rather than setting a definite content to a pseudo element (::before or ::after), you are able to set it to the contents of an attribute. Here the data-hover attribute contains duplicate text, but it easily could contain other text. Overflow is then set to hidden on the parent element to control text is in view.

First noticed at http://lateliertokyo.com/