Presentation attributes

We present here the most spread presentation attributes. To fund all attributes see W3C SVG 1.1 Recommendation.

Color

Attribute Value Initial
color <color> depends on user agent
color-profile auto | sRGB | <name> | <uri> | inherit auto
color-rendering auto | optimizeSpeed | optimizeQuality | inherit auto
color-interpolation auto | sRGB | linearRGB | inherit sRGB

The color attributes is applied to the following elements:

<image>, <path>, <rect>, <circle>, <ellipse>, <line>, <polyline>, <polygon>, <text>, <linearGradient>, <radialGradient>, <stop>, <clipPath>, <feDiffuseLighting>, <feFlood>, <feSpecularLighting>.

FillStroke

FillStroke attributes are used to fill (place a color inside an object) and stroke (draw lines around an object) vector objects.

Attribute Value Initial
fill <paint> black
fill-rule nonzero | evenodd | inherit nonzero
fill-opacity <opacity-value> | inherit 1
stroke <paint> none
stroke-width <length> | inherit 1
stroke-linecap butt | round | square | inherit butt
stroke-linejoin miter | round | bevel | inherit miter
stroke-miterlimit <miterlimit> | inherit 4
stroke-dasharray none | <dasharray> | inherit none
stroke-dashoffset <length> | inherit 0
stroke-opacity <opacity-value> | inherit 1

FillStroke attributes are applied to the following elements: <path>, <rect>, <circle>, <ellipse>, <line>, <polyline>, <polygon>, <text>, <tspan>, <tref>, <textpath>, <altGlyph>, <clipPath>.

FontSpecification

Font specification in SVG is based on CSS.

Attribute Value Initial
font-family CSS font family depends on user agent
font-style normal | italic | oblique | inherit normal
font-weight normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | inherit normal
font-stretch normal | wider | narrower | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded | inherit normal
font-size <absolute-size> | <relative-size> | <length> | <percentage> | inherit medium

Font specification attributes are applied to <text>, <tspan>, <tref>, <textpath>, <altGlyph>, <glyphRef>, <clipPath> elements.

Graphics

The presented attributes are shared by all graphic elements.

Attribute Value Initial
clip-path <uri> | none | inherit none
clip-rule nonzero | evenodd | inherit nonzero
mask <uri> | none | inherit none
opacity <opacity-value> | inherit 1
display inline | block | list-item | run-in | compact | marker | table | inline-table | table-row-group | table-header-group | table-footer-group | table-row | table-column-group | table-column | table-cell | table-caption | none | inherit inline
filter <uri> | none | inherit none
visibility visible | hidden | collapse | inherit visible

Graphics attributes are applied to <image>, <path>, <rect>, <circle>, <ellipse>, <line>, <polyline>, <polygon>, <text>, <tspan>, <tref>, <textpath>, <altGlyph>, <clipPath> elements.

Markers

Attribute Value Initial
marker-start
marker-end none | inherit | <uri> none
marker-mid

Markers attributes are applied to <path>, <line>, <polyline> and <polygon> elements.

TextContent

Attribute Value Initial
text-anchor start | middle | end | inherit start
dominant-baseline auto | use-script | no-change | reset-size | ideographic | alphabetic | hanging | | mathematical | central | middle | text-after-edge | text-before-edge | inherit auto
alignment-baseline auto | baseline | before-edge | text-before-edge | middle | central | after-edge | text-after-edge | ideographic | alphabetic | hanging | mathematical | inherit auto
baseline-shift baseline | sub | super | | | inherit baseline
letter-spacing normal | <length> | inherit normal
word-spacing normal | <length> | inherit normal
text-decoration none | [ underline || overline || line-through || blink ] | inherit none
writing-mode lr-tb | rl-tb | tb-rl | lr | rl | tb | inherit lr-tb
glyph-orientation-vertical auto | <angle> | inherit auto
glyph-orientation-horizontal <angle> | inherit 0deg

Text attributes are applied to the following elements: <text>, <tspan>, <tref>, <textpath>, <altGlyph>, <clipPath>.