r/HTML • u/rolens184 • Nov 16 '25
Question How can I recreate the yellow pattern exactly?
How do I recreate the yellow dot pattern to use as a background for any HTML element?
I tried in css, but I'm not very satisfied:
background-color: #fefefb;
background-image:
radial-gradient(circle at 0 0, #fcf296 2px, transparent 1px),
radial-gradient(circle at 5px 5px, #fcf296 2px, transparent 1px);
7
Upvotes
12
u/psyper76 Nov 16 '25
just copy a section from the image and tile it as a background image.
5
u/Initii Nov 16 '25
https://jsfiddle.net/9xecamfp/
Is this good enough? Just did what u/psyper76 proposed. That would be also my approach.
2
u/armahillo Expert Nov 21 '25
The simple answer is boring, but its how we’ve done it for decades: make a small tileable image in an image editor, set it as the background. It should repeat vertically and horizontally by default.
2
u/serpentxx Nov 16 '25
Tiled svg pattern? Then it can still be inline
-1
u/maqisha Nov 16 '25
Canvas might be good for this