Skip to main content
100%

Shapes and Colors with SVG and CSS

✓ Published1🌍 Public
DDy-Diana
Last edited Nov 7, 2020
Created on Nov 7, 2020

This example demonstrates how to create and style basic SVG shapes—circles, rectangles, lines, and paths—using both inline attributes and CSS classes. A root `<g>` element applies a global scale transform, while nested groups use translate to position shape clusters, with one group inheriting fill and stroke styles and another defining thick, rounded line styles via the `.lines` class. The SVG is rendered directly in HTML with a 960×500 viewport, and CSS controls body margins and line appearance.

AI-generated description

An example including some commonly used features of SVG.

MIT Licensed

Similar vizzes