x property describes the horizontal coordinate of the position of the element.
| 名称 | x |
| 值 | <length> | <percentage> |
| Initial | 0 |
| 适用于 |
<mask>
, ‘
svg
’, ‘
rect
’, ‘
image
’, ‘
foreignObject
’
|
| 继承 | no |
| 百分比 | refer to the size of the current viewport (see Units ) |
| Media | visual |
| 计算值 | absolute length or percentage |
| Animatable | yes |
A <coordinate> is a length in the user coordinate system that is the given distance from the origin of the user coordinate system along the relevant axis (the x-axis for X coordinates, the y-axis for Y coordinates). Its syntax is the same as that for <length>
// Rect draws a rectangle with upper left-hand corner at x,y, with width w, and height h, with optional style
// Standard Reference: http://www.w3.org/TR/SVG11/shapes.html#RectElement
func (svg *SVG) Rect(x float64, y float64, w float64, h float64, s ...string) {
svg.printf(`<rect %s %s`, dim(x, y, w, h, svg.Decimals), endstyle(s, emptyclose))
}