Skip to main content
100%

Shapes with SVG and CSS

✓ Published1🌍 Public
Ttheaddies
Last edited Feb 20, 2022
Created on Feb 20, 2022
Forked from HTML Starter

This example demonstrates how to create basic SVG shapes and style them using CSS. It shows six circles and rectangles, some with explicitly set fill colors and others styled through CSS classes, along with a line and a polyline path. The code uses raw SVG elements like `<circle>`, `<rect>`, `<line>`, and `<path>` within an `<svg>` tag, applied using React’s JSX syntax. CSS rules in a linked stylesheet control the stroke properties of the line elements, while the SVG `transform` attribute scales and translates the shapes.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

MIT Licensed

Similar vizzes