Skip to main content
100%

Sol LeWitt learn something about mask

✓ Published1🌍 Public
Ddmr
Last edited Nov 15, 2021
Created on Nov 14, 2021

This example presents a set of minimal SVG experiments that illustrate fundamental concepts like the `viewBox` coordinate system, default pixel dimensions, and basic geometric shapes. Consecutive squares with circles show how changing the `viewBox` alters the visible portion of the artwork, acting as a crop or virtual artboard. The page also demonstrates basic polygons and rectangles with varied fills, strokes, and positioning, using raw SVG elements within an HTML document. The code relies on the core SVG API for rendering, not external libraries.

AI-generated description

learn how to use mask before applying it to Sol LeWitt

mdn mask

viewbox

The viewBox attribute defines the position and dimension, in user space, of an SVG viewport. The value of the viewBox attribute is a list of four numbers:

  • min-x
  • min-y
  • width
  • height

The numbers separated by whitespace and/or a comma, which specify a rectangle in user space which is mapped to the bounds of the viewport established for the associated SVG element

viewbox version 2

which part of the SVG is visible - the artboard

It's the crop of the underlying image

  • starting x
  • starting y
  • width
  • height

There is an implied aspect ratio which van be overridden using the preserveAspectRatio attribute

polygon

The polygon element defines a closed shape consisting of a set of connected straight line segments. The last point is connected to the first point.

Learn SVG through 24 examples

  • SVG width and height default to pixels
  • viewBox is coordinates
  • For example, 50px by 50px "image" can have a coordinate system for x and y of 0 to 100
  • Then for CIRCLE cx, cy and r specified as coordinates
MIT Licensed

Similar vizzes