Skip to main content
100%

Shapes and Colors with SVG and CSS

✓ Published0🌍 Public
Ssbgatech
Last edited Dec 20, 2020
Created on Dec 20, 2020

This example demonstrates basic SVG shapes—circles, rectangles, lines, and a polyline path—styled through inline attributes and an external CSS stylesheet. It shows how presentation attributes like `fill`, `stroke`, and `stroke-width` can be overridden by CSS rules, as seen with the `.lines` class applying black strokes. The SVG is scaled using a transform and grouped with translation to position elements, while CSS handles global layout. The code uses raw SVG elements and CSS, with no data or interaction.

AI-generated description

An example including some commonly used features of SVG.

MIT Licensed

Similar vizzes