Skip to main content
100%

Shapes with SVG and CSS

✓ Published0🌍 Public
JJMason88
Last edited Jun 4, 2019
Created on Jun 4, 2019
Forked from HTML Cars Report

This example demonstrates the fundamental SVG shapes—circle, rectangle, line, and path—as rendered through a combination of inline SVG markup and CSS styling. The code showcases how to apply fills, strokes, and stroke widths directly on elements, as well as how to group shapes for shared visual attributes using the `transform` and `g` elements. The CSS stylesheet defines classes (`.lines`) to control stroke properties and `stroke-linejoin`, while also setting a global body margin. The page uses a 960x500 SVG canvas with a scale transformation to enlarge the displayed shapes.

AI-generated description

An example showing the capabilities of VizHub.

MIT Licensed

Similar vizzes