Skip to main content
100%

Shapes with SVG and CSS

✓ Published1🌍 Public
AAntonio Rungo
Last edited Feb 17, 2020
Created on Feb 16, 2020
Forked from HTML Starter

This example demonstrates how SVG shapes—circles, rectangles, lines, and paths—can be styled directly with CSS properties such as `fill`, `stroke`, and `stroke-width`. It shows the contrast between shapes with default black fills, individually assigned colors, and a group inheriting a blue fill with a black stroke. The code uses raw SVG elements and CSS rules, including a `.lines` class for stroke styling and a nested `<g>` transform to reposition shapes. No external libraries are used, relying solely on native SVG and CSS.

AI-generated description
MIT Licensed

Similar vizzes