Why repeating text on the web is harder than it looks
Repeated text as a background is a common advertising device: GoCompare built a major multi-channel campaign on it, and Nike has used it too. Reproducing the effect on the web is less straightforward. Repeating the words directly in markup works, but it is noisy for assistive technology — a screen reader would read the text out loud over and over.
Versatility
Versatility
Versatility
Versatility
Exporting the design as an image from a tool like Photoshop avoids that, but images are bad for both SEO and accessibility.
The element() function
CSS has a long-existing, badly supported feature that fits this problem: element(). It lets you use any HTML element — a single button, or an entire <div> full of content — as a background image. The spec is explicit about what that means:
The element() function only reproduces the appearance of the referenced element, not the actual content and its structure. Authors should only use this for decorative purposes.
For a repeating-text effect, the referenced element is a text element.
Implementation
Give the text you want to repeat an ID — say #thingy. The element() value must be prefixed with -moz-. Firefox has supported the feature since 2010; no other browser has shipped it since.
.element {
background-image: -moz-element(#thingy);
}
The example below is a loose recreation of the Nike advertisement and requires Firefox to display as intended. The technique: an element (#versatility) sits in the page with zero height so it is hidden, is set as the background-image on the body, and background-repeat duplicates it vertically down the page.
A live, decorative background
The element() background is live: if the referenced HTML element changes, the appearance of the element using it as a background changes too. The behavior resembles custom properties, where changing the variable updates every place it is used.
Other uses
- Preethi used the function to build in-page scrolling navigation for an article.
- A
canvaselement can serve as a background for more elaborate effects. - It can show screenshots of pages in a table of contents.
- Vincent De Oliveira has documented wildly creative examples, including an image-reflection effect for retro-style designs.
Browser support and next steps
This is not a production-ready approach today. Open tickets exist in WebKit and Chromium where you can make your voice heard for features you want implemented, so the feature may eventually reach Safari and Chrome.



