SVG Flashcards

1
Q

SVG

A

= Scalable Vector Graphics

An XML-based image format that describes graphics using geometrical attributes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are SVG primitives?

A

Individual XML elements described using tags and attributes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

SVG Stacking

A

The code order determines which element will appear over the other. Preceding siblings are always overlapped by siblings declared after them.

z-index doesn’t work in SVG.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

SVG defs

A

A header containing SVG elements that will not be displayed until referenced by a ‘use’ element.

Filters, clippings, gradients, masks and reusable shapes are usually declared here.

Each of the elements within must have an id in order to be referencable.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

SVG use

A

An SVG tag used for displaying one of the elements declared in the header.

The element is referenced by id using the xlink notation:

use xlink:href="#myShape" /

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Matrix transforms

A

Used to scale(), translate(), skew(), or rotate() any shape or group or the entire SVG viewport.

These commands are used inside of the transform XML attribute, and their order is significant.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

viewBox attribute values

A

viewBox=“x y w h”

x, y - the centre of coordinates

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Gradients

A

Linear gradients are created perpendicular to a line so they require the same attributes as the line element. Radial gradients use circle attributes.

Gradients should have at least one child stop with:

  • a non-zero ‘offset’ and
  • stop-color different than black

Gradients are usually declared in the defs header, and used as a fill or stroke value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Clip mask

A

Clip mask is created with any element declared inside the clipPath element.

This is usually done in the defs header.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly