DEV Community

Alvaro Montoro
Alvaro Montoro

Posted on

13 1

Drawing a Giraffe with CSS

Yesterday I did a quick cartoon of a giraffe using HTML and CSS:

The process went like this:

  1. Drew the snout by doing an ellipse and adding some rotation
  2. The head is a rotated oval
  3. A pseudo-element of the snout made a circle for the nose, and added some shadows to duplicate it
  4. For the mouth, we used another pseudo-element of the snout, we made it into an ellipse and use the bottom border for the line.
  5. The eyes are a rounded pseudo-element of the head and its shadow
  6. Then for the hair, another pseudo-element of the head shaped like an ellipse and with an inset box-shadow.
  7. Both ears are a single element and its ::after by making them squares with opposite rounded corners.
  8. The horns were placed behind the head but in a position that makes them look like one is on top and the other one behind.
  9. A really tall rectangle made the neck
  10. A similar rectangle made the mane, with a small rotation and cropping small triangles to make it irregular.
  11. Finally, for the dots in the neck, we use a neck pseudo-element and a bunch of box-shadows :)

Here there is a timelapse video of the process:

Sentry blog image

How I fixed 20 seconds of lag for every user in just 20 minutes.

Our AI agent was running 10-20 seconds slower than it should, impacting both our own developers and our early adopters. See how I used Sentry Profiling to fix it in record time.

Read more

Top comments (2)

Collapse
 
raounek profile image
touibeg mohamed

thanks no more images!!!

Collapse
 
ikurosaki profile image
ikurosaki

Waooo genial .

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more