Thursday, April 25

Author: Jon Kantner

Drawing Images with CSS Gradients
CSS Tricks

Drawing Images with CSS Gradients

What I mean by "CSS images" is images that are created using only HTML elements and CSS. They look as if they were SVGs drawn in Adobe Illustrator but they were made right in the browser. Some techniques I’ve seen used are tinkering with border radii, box shadows, and sometimes clip-path. You can find a lot of great examples if you search daily css images" on CodePen. I drew some myself, including this Infinity Gauntlet, but in one element with only backgrounds and minimal use of other properties. Let’s take a look at how you can create CSS images that way yourself. The Method Understanding the shorthand background syntax as well as how CSS gradients work is practically all you need to draw anything in one element. As a review, the arguments are as follows: background: <'background-co...