concept

Svg geometry properties — CSS reference

Selected SVG geometry attributes also have CSS property forms. These affect the shape itself, unlike a transform that maps its coordinate space. The example changes both the rectangle origin and width.

Formal Syntax & Structure

css syntaxcss
rect { x: 60px; width: 120px; }

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>SVG geometry properties</title><style>body{margin:0;background:white}svg{display:block}#a{x:60px;width:120px}</style><body><svg xmlns="http://www.w3.org/2000/svg" width="240" height="160" viewBox="0 0 240 160" role="img" aria-label="SVG styling example"><rect id="a" x="40" y="40" width="100" height="80"/></svg></body></html>
CSS Reference