Skip to main content
100%

Shapes and Colors with SVG and CSS

✓ Published1🌍 Public
SShantanu Tripathi
Last edited Jun 28, 2020
Created on Jun 28, 2020

This example demonstrates how SVG shapes—circles, rectangles, lines, and paths—can be styled and transformed using CSS and SVG attributes. It shows a scaled and translated group of basic geometric forms, with colors applied both directly in the markup (e.g., `fill="red"`, `fill="#83cc2a"`) and via CSS classes like `.lines`. The illustration highlights inheritance of presentation properties, such as fill and stroke, from parent `<g>` elements, while also showcasing stroke width, line join, and cap styling on a polyline and a path.

AI-generated description

An example including some commonly used features of SVG.

MIT Licensed

Similar vizzes