SVG Fundamentals
✓ Published0🌍 Public
This example demonstrates the fundamental SVG shapes—circle, rectangle, line, and path—drawn directly within an HTML page. It shows how CSS and JavaScript can be used to define and render vector graphics. The code uses raw SVG elements with inline attributes like `cx`, `cy`, `r`, `x`, `y`, `width`, `height`, and `stroke`, alongside the `fill` and `stroke-width` properties. The SVG canvas is set to 960 by 500 pixels, displaying basic shapes in red, green, blue, and black. A path element connects points with a straight line, while the line and rectangle include distinct stroke styling.
AI-generated descriptionA bare minimum HTML page demonstrating use of CSS and JavaScript.
See also React Starter.
MIT Licensed