SvgAttribute
API reference › HTML SVG › Values › SvgAttribute
Represents standardized attribute names for the SVG <svg> element.
Provides literal string values for SVG attribute names.
See also: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute.
| Case | Value | Description |
|---|---|---|
CLIP_PATH_UNITS | 'clipPathUnits' | clipPathUnits - Defines the coordinate system for the contents of the <clipPath> element. |
CX | 'cx' | cx - Center x-coordinate of a circle or ellipse element. |
CY | 'cy' | cy - Center y-coordinate of a circle or ellipse element. |
D | 'd' | d - Path data string for <path> elements. |
DECODING | 'decoding' | decoding - Provides an image decoding hint for <image> elements. |
DOMINANT_BASELINE | 'dominant-baseline' | dominant-baseline - Dominant baseline positioning attribute. |
DX | 'dx' | dx - Horizontal offset for text positioning. |
DY | 'dy' | dy - Vertical offset for text positioning. |
FETCHPRIORITY | 'fetchpriority' | fetchpriority - Hints the browser about the fetch priority for the resource. |
FILL | 'fill' | fill - Fill attribute has two different meanings. |
FILL_OPACITY | 'fill-opacity' | fill-opacity - Fill opacity attribute specifies the transparency of the fill paint. |
FILL_RULE | 'fill-rule' | fill-rule - Fill rule attribute indicates which algorithm to use to determine the inside part of a shape. |
FILTER_UNITS | 'filterUnits' | filterUnits - Defines the coordinate system for the contents of the <filter> element. |
FONT_FAMILY | 'font-family' | font-family - Font family for text content. |
FONT_SIZE | 'font-size' | font-size - Font size for text content. |
FONT_STYLE | 'font-style' | font-style - Font style for text content. |
FONT_WEIGHT | 'font-weight' | font-weight - Font weight for text content. |
FR | 'fr' | fr - Radius of the start circle of the radial gradient. |
FX | 'fx' | fx - Center x-coordinate of the start circle of the radial gradient. |
FY | 'fy' | fy - Center y-coordinate of the start circle of the radial gradient. |
GRADIENT_TRANSFORM | 'gradientTransform' | gradientTransform - Defines a transformation applied to the gradient coordinate system. |
GRADIENT_UNITS | 'gradientUnits' | gradientUnits - Defines the coordinate system for gradient attributes. |
HEIGHT | 'height' | height — Specifies the height of certain elements. |
HREF | 'href' | href - Defines a reference to an external resource or SVG fragment. |
LENGTH_ADJUST | 'lengthAdjust' | lengthAdjust - Controls how text is stretched or compressed to fit the width defined by textLength. |
LETTER_SPACING | 'letter-spacing' | letter-spacing - Controls spacing between text characters. |
MARKER_HEIGHT | 'markerHeight' | markerHeight - Represents the height of the viewport into which the marker is to be fitted. |
MARKER_UNITS | 'markerUnits' | markerUnits - Defines the coordinate system for attributes markerWidth, markerHeight, and marker contents. |
MARKER_WIDTH | 'markerWidth' | markerWidth - Represents the width of the viewport into which the marker is to be fitted. |
MASK_CONTENT_UNITS | 'maskContentUnits' | maskContentUnits - Defines the coordinate system for the contents of the <mask> element. |
MASK_TYPE | 'mask-type' | mask-type - Defines the mask mode for the contents of the <mask> element. |
MASK_UNITS | 'maskUnits' | maskUnits - Defines the coordinate system for x, y, width, and height of the <mask> element. |
OFFSET | 'offset' | offset - Defines the location of a gradient stop along a gradient vector. |
OPACITY | 'opacity' | opacity - Opacity attribute specifies the transparency of an element. |
ORIENT | 'orient' | orient - Indicates how the marker is rotated when placed at its position on the shape. |
PATH_LENGTH | 'pathLength' | pathLength - Specifies the total length for the path. |
PATTERN_CONTENT_UNITS | 'patternContentUnits' | patternContentUnits - Defines the coordinate system for the contents of the <pattern> element. |
PATTERN_TRANSFORM | 'patternTransform' | patternTransform - Defines a list of transformations applied to the pattern tile. |
PATTERN_UNITS | 'patternUnits' | patternUnits - Defines the coordinate system for the geometry of the <pattern> element. |
POINTS | 'points' | points - List of points for polyline and polygon elements. |
PRESERVE_ASPECT_RATIO | 'preserveAspectRatio' | preserveAspectRatio - Indicates how content with a viewBox must fit into a viewport with a different aspect ratio. |
PRIMITIVE_UNITS | 'primitiveUnits' | primitiveUnits - Defines the coordinate system for the contents of filter primitive elements. |
R | 'r' | r - Radius of a circle element. |
REF_X | 'refX' | refX - Defines the x coordinate for the reference point of the marker. |
REF_Y | 'refY' | refY - Defines the y coordinate for the reference point of the marker. |
ROTATE | 'rotate' | rotate - Rotation values for individual glyphs in text. |
RX | 'rx' | rx - The x-axis radius of the ellipse. |
RY | 'ry' | ry - The y-axis radius of the ellipse. |
SPREAD_METHOD | 'spreadMethod' | spreadMethod - Indicates how a gradient behaves if it starts or ends inside the bounds of the shape. |
STOP_COLOR | 'stop-color' | stop-color - Defines the color of a gradient stop. |
STOP_OPACITY | 'stop-opacity' | stop-opacity - Defines the opacity of a gradient stop. |
STROKE | 'stroke' | stroke - Stroke attribute is a presentation attribute defining the color (or any SVG paint servers like gradients or patterns) used to paint the outline of the shape. |
STROKE_DASHARRAY | 'stroke-dasharray' | stroke-dasharray - Stroke dasharray attribute is a presentation attribute defining the pattern of dashes and gaps used to stroke paths. |
STROKE_LINECAP | 'stroke-linecap' | stroke-linecap - Stroke linecap attribute is a presentation attribute defining the shape to be used at the end of open subpaths when they are stroked. |
STROKE_LINEJOIN | 'stroke-linejoin' | stroke-linejoin - Stroke linejoin attribute is a presentation attribute defining the shape to be used at the corners of paths or basic shapes when they are stroked. |
STROKE_MITERLIMIT | 'stroke-miterlimit' | stroke-miterlimit - Stroke miterlimit attribute is a presentation attribute defining a limit on the ratio of the miter length to the stroke-width. |
STROKE_OPACITY | 'stroke-opacity' | stroke-opacity - Stroke opacity attribute specifies the transparency of the stroke paint. |
STROKE_WIDTH | 'stroke-width' | stroke-width - Stroke width attribute is a presentation attribute defining the width of the outline on the current object. |
TEXT_ANCHOR | 'text-anchor' | text-anchor - Text anchor positioning attribute. |
TEXT_DECORATION | 'text-decoration' | text-decoration - Text decoration styling attribute. |
TEXT_LENGTH | 'textLength' | textLength - Target length for text rendering. |
TITLE | 'title' | title - Advisory title text for elements that expose the global title attribute. |
TRANSFORM | 'transform' | transform - Transform attribute defines a list of transform definitions that are applied to an element and the element’s children. |
VIEW_BOX | 'viewBox' | viewBox - Defines the position and dimension, in user space, of an SVG viewport. |
WIDTH | 'width' | width — Specifies the width of certain elements. |
WORD_SPACING | 'word-spacing' | word-spacing - Controls spacing between words in text. |
WRITING_MODE | 'writing-mode' | writing-mode - Defines text direction and orientation. |
X | 'x' | x - Displayed x coordinate of the SVG container. No effect on outermost svg elements. |
X1 | 'x1' | x1 - First x coordinate for drawing an SVG element. |
X2 | 'x2' | x2 - Second x coordinate for drawing an SVG element. |
XMLNS | 'xmlns' | xmlns - XML namespace for the SVG element. |
Y | 'y' | y - Displayed y coordinate of the SVG container. No effect on outermost svg elements. |
Y1 | 'y1' | y1 - First y coordinate for drawing an SVG element. |
Y2 | 'y2' | y2 - Second y coordinate for drawing an SVG element. |