From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/svg/element/rect/index.html | 142 ++++++++++++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 files/zh-cn/web/svg/element/rect/index.html (limited to 'files/zh-cn/web/svg/element/rect/index.html') diff --git a/files/zh-cn/web/svg/element/rect/index.html b/files/zh-cn/web/svg/element/rect/index.html new file mode 100644 index 0000000000..0f33cf99c1 --- /dev/null +++ b/files/zh-cn/web/svg/element/rect/index.html @@ -0,0 +1,142 @@ +--- +title: rect +slug: Web/SVG/Element/rect +tags: + - SVG + - SVG图形 + - 元素 + - 参考 +translation_of: Web/SVG/Element/rect +--- +
{{SVGRef}}
+ +

rect元素是SVG的一个基本形状,用来创建矩形,基于一个角位置以及它的宽和高。它还可以用来创建圆角矩形。

+ +

用法

+ +

{{svginfo}}

+ +

示例

+ +

简单矩形

+ +

 

+ +
<?xml version="1.0"?>
+<svg width="120" height="120"
+     viewBox="0 0 120 120"
+     xmlns="http://www.w3.org/2000/svg">
+
+  <rect x="10" y="10" width="100" height="100"/>
+</svg>
+ +

 

+ +

» rect-1.svg

+ +

圆角矩形

+ +

 

+ +
<?xml version="1.0"?>
+<svg width="120" height="120"
+     viewBox="0 0 120 120"
+     xmlns="http://www.w3.org/2000/svg">
+
+  <rect x="10" y="10"
+        width="100" height="100"
+        rx="15" ry="15"/>
+
+</svg>
+ +

 

+ +

» rect-2.svg

+ +

属性

+ +

全局属性

+ + + +

专有属性

+ + + +

DOM 接口

+ +

这个元素实现了 SVGRectElement 接口。

+ +

浏览器支持

+ +

{{ CompatibilityTable() }}

+ +
+ + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support1.0{{ CompatGeckoDesktop('1.8') }}{{ CompatIE('9.0') }}{{ CompatOpera('8.0') }}{{ CompatSafari('3.0.4') }}
+
+ +
+ + + + + + + + + + + + + + + + + + + +
FeatureAndroidFirefox Mobile (Gecko)IE PhoneOpera MobileSafari Mobile
Basic support{{ CompatAndroid('3.0') }}{{ CompatGeckoMobile('1.8') }}{{ CompatNo() }}{{ CompatVersionUnknown() }}{{ CompatSafari('3.0.4') }}
+
+ +

该表格基于这些资源

+ +

参见

+ + -- cgit v1.2.3-54-g00ecf