Skip to main content
100%

Shapes with SVG and CSS

✓ Published1🌍 Public
Iihatelearning
Last edited Feb 12, 2021
Created on Feb 12, 2021
Forked from HTML Cars Report

This example demonstrates how to construct simple geometric shapes—circles, rectangles, lines, and paths—using inline SVG elements within an HTML page. The visualization shows how SVG properties like `fill`, `stroke`, and `stroke-width` can be applied directly or through CSS classes, with the first row using default black fills and the second applying explicit red and green colors. A group with `translate` and `stroke` attributes renders white shapes with black outlines, while a separate `.lines` class sets a thick black stroke on line and path elements, with the path receiving a distinct teal color and rounded joins via CSS. The scene is scaled up by a factor of 1.5 using an SVG transform.

AI-generated description
MIT Licensed

Similar vizzes