Skip to main content
100%

Shapes with SVG and CSS

✓ Published0🌍 Public
YYifu Chen
Last edited Oct 2, 2020
Created on Oct 2, 2020

This example demonstrates basic geometric shapes rendered with SVG elements inside an HTML page, using CSS to style page layout. It shows a circle, a rectangle, a group containing both shapes, and a blue line, all positioned within a fixed 960x500 SVG viewport. The visualization relies on native SVG tags (`circle`, `rect`, `g`, `line`) directly in the markup, with attributes like `cx`, `cy`, `r`, `fill`, and `stroke` controlling appearance. A linked stylesheet (`styles.css`) manages body margins and overflow, while inline SVG attributes handle shape-specific formatting. No JavaScript libraries are used; the example purely demonstrates static SVG rendering.

AI-generated description
MIT Licensed

Similar vizzes