SVGRect
represents a rectangle. Rectangles consist of an x and y coordinate pair identifying a minimum x value, a minimum y value, and a width and height, which are constrained to be non-negative.
An
SVGRect
object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown.
<div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" preserveAspectRatio="xMinYMin meet"><a xlink:href="../API/SVGRect" target="_top"><rect x="1" y="1" width="75" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">SVGRect</text></a></svg></div>
a:hover text { fill: #0095DD; pointer-events: all;}
SVGRect.x
0
were specified.
SVGRect.y
0
were specified.
SVGRect.width
This represents the width of the rectangle.A value that is negative results to an error. A value of zero disables rendering of the element
SVGRect.height
This represents the height of the rectangle.A value that is negative results to an error.A value of zero disables rendering of the element.
This interface also inherits properties from its parent,
DOMRectReadOnly
.
| 规范 | 状态 | 注释 |
|---|---|---|
|
Geometry Interfaces Module Level 1
The definition of 'DOMRect' in that specification. |
候选推荐 | Changed SVGRect as a legacy alias of DOMRect. |
|
Scalable Vector Graphics (SVG) 1.1 (Second Edition)
The definition of 'SVGRect' in that specification. |
推荐 | 初始定义 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
SVGRect
|
Chrome 1 | Edge 12 | Firefox 1.5 | IE 9 | Opera 8 | Safari 3.1 | WebView Android 1 | Chrome Android 18 | Firefox Android 4 | Opera Android 10.1 | Safari iOS 3.1 | Samsung Internet Android 1.0 |
height
|
Chrome 1 | Edge 12 | Firefox ? | IE ? | Opera ? | Safari ? | WebView Android 1 | Chrome Android 18 | Firefox Android ? | Opera Android ? | Safari iOS ? | Samsung Internet Android 1.0 |
width
|
Chrome 1 | Edge 12 | Firefox ? | IE ? | Opera ? | Safari ? | WebView Android 1 | Chrome Android 18 | Firefox Android ? | Opera Android ? | Safari iOS ? | Samsung Internet Android 1.0 |
x
|
Chrome 1 | Edge 12 | Firefox ? | IE ? | Opera ? | Safari ? | WebView Android 1 | Chrome Android 18 | Firefox Android ? | Opera Android ? | Safari iOS ? | Samsung Internet Android 1.0 |
y
|
Chrome 1 | Edge 12 | Firefox ? | IE ? | Opera ? | Safari ? | WebView Android 1 | Chrome Android 18 | Firefox Android ? | Opera Android ? | Safari iOS ? | Samsung Internet Android 1.0 |
完整支持
兼容性未知
SVGRect
SVGAElement
SVGAltGlyphElement
SVGAngle
SVGAnimateColorElement
SVGAnimateElement
SVGAnimateMotionElement
SVGAnimateTransformElement
SVGAnimatedAngle
SVGAnimatedBoolean
SVGAnimatedEnumeration
SVGAnimatedInteger
SVGAnimatedLength
SVGAnimatedLengthList
SVGAnimatedNumber
SVGAnimatedNumberList
SVGAnimatedPathData
SVGAnimatedPoints
SVGAnimatedPreserveAspectRatio
SVGAnimatedRect
SVGAnimatedString
SVGAnimatedTransformList
SVGAnimationElement
SVGCircleElement
SVGClipPathElement
SVGComponentTransferFunctionElement
SVGCursorElement
SVGDefsElement
SVGDescElement
SVGDocument
SVGElement
SVGEllipseElement
SVGFEBlendElement
SVGFEColorMatrixElement
SVGFEComponentTransferElement
SVGFECompositeElement
SVGFEConvolveMatrixElement
SVGFEDiffuseLightingElement
SVGFEDisplacementMapElement
SVGFEDistantLightElement
SVGFEDropShadowElement
SVGFEFloodElement
SVGFEFuncAElement
SVGFEFuncBElement
SVGFEFuncGElement
SVGFEFuncRElement
SVGFEGaussianBlurElement
SVGFEImageElement
SVGFEMergeElement
SVGFEMergeNodeElement
SVGFEMorphologyElement
SVGFEOffsetElement
SVGFEPointLightElement
SVGFESpecularLightingElement
SVGFESpotLightElement
SVGFETileElement
SVGFETurbulenceElement
SVGFilterElement
SVGFilterPrimitiveStandardAttributes
SVGFitToViewBox
SVGFontElement
SVGFontFaceElement
SVGFontFaceFormatElement
SVGFontFaceNameElement
SVGFontFaceSrcElement
SVGFontFaceUriElement
SVGForeignObjectElement
SVGGElement
SVGGlyphElement
SVGGradientElement
SVGGraphicsElement
SVGHKernElement
SVGImageElement
SVGLength
SVGLengthList
SVGLineElement
SVGLinearGradientElement
SVGMPathElement
SVGMarkerElement
SVGMaskElement
SVGMatrix
SVGMetadataElement
SVGMissingGlyphElement
SVGNumber
SVGNumberList
SVGPathElement
SVGPathSeg
SVGPathSegArcAbs
SVGPathSegArcRel
SVGPathSegClosePath
SVGPathSegCurvetoCubicAbs
SVGPathSegCurvetoCubicRel
SVGPathSegCurvetoCubicSmoothAbs
SVGPathSegCurvetoCubicSmoothRel
SVGPathSegCurvetoQuadraticAbs
SVGPathSegCurvetoQuadraticRel
SVGPathSegCurvetoQuadraticSmoothAbs
SVGPathSegCurvetoQuadraticSmoothRel
SVGPathSegLinetoAbs
SVGPathSegLinetoHorizontalAbs
SVGPathSegLinetoHorizontalRel
SVGPathSegLinetoRel
SVGPathSegLinetoVerticalAbs
SVGPathSegLinetoVerticalRel
SVGPathSegList
SVGPathSegMovetoAbs
SVGPathSegMovetoRel
SVGPatternElement
SVGPoint
SVGPointList
SVGPolygonElement
SVGPolylineElement
SVGPreserveAspectRatio
SVGRadialGradientElement
SVGRectElement
SVGSVGElement
SVGScriptElement
SVGSetElement
SVGStopElement
SVGStringList
SVGStylable
SVGStyleElement
SVGSwitchElement
SVGSymbolElement
SVGTRefElement
SVGTSpanElement
SVGTests
SVGTextContentElement
SVGTextElement
SVGTextPathElement
SVGTextPositioningElement
SVGTitleElement
SVGTransform
SVGTransformList
SVGTransformable
SVGURIReference
SVGUnitTypes
SVGUseElement
SVGVKernElement
SVGViewElement
SVGZoomAndPan
SVGZoomEvent
TimeEvent