Skip to main content
100%

Shapes with SVG and CSS

✓ Published1🌍 Public
Nnorangai
Last edited Nov 1, 2019
Created on Nov 1, 2019

This example demonstrates drawing primitive geometric shapes—circles, rectangles, lines, and a custom path—using SVG elements directly in an HTML document without any JavaScript library. CSS rules in an external stylesheet apply stroke styling, with a class selector setting line color and width. A `<g>` element uses the `transform` attribute to translate and scale a grouped collection of shapes, while inline presentation attributes assign fills and strokes. The SVG canvas is 960 by 500 pixels, and CSS sets the body to a monospace font with hidden overflow.

AI-generated description

Cars report

MIT Licensed

Similar vizzes