Skip to main content
Public

Share visualization

Loading preview…

Shapes and Colors with SVG and CSS

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

Shapes and Colors with SVG and CSS

0
RRemustus
Last edited Oct 6, 2019
Created on Oct 6, 2019

This example demonstrates how SVG shapes and CSS styling can be combined to create static vector graphics. It shows circles, rectangles, lines, and a path, with colors applied both through inline attributes like `fill="red"` and `fill="#83cc2a"`, as well as through CSS classes defined in `styles.css`. The `<g>` elements use the `transform` attribute to group and position shapes, including `scale` and `translate` operations. Rendering relies purely on SVG within an HTML document, with no JavaScript libraries, and the external stylesheet controls stroke properties for the line and path elements.

AI-generated description

An example including some commonly used features of SVG.

Comments

Sign in to join the discussion.

MIT Licensed