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/css/clip/index.html | 153 ++++++++++++++++++++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100644 files/zh-cn/web/css/clip/index.html (limited to 'files/zh-cn/web/css/clip/index.html') diff --git a/files/zh-cn/web/css/clip/index.html b/files/zh-cn/web/css/clip/index.html new file mode 100644 index 0000000000..25b8eb6407 --- /dev/null +++ b/files/zh-cn/web/css/clip/index.html @@ -0,0 +1,153 @@ +--- +title: clip +slug: Web/CSS/clip +translation_of: Web/CSS/clip +--- +
{{CSSRef}}{{deprecated_header}}
+ +

概述

+ +

clip 属性定义了元素的哪一部分是可见的。clip 属性只适用于 {{ cssxref("position","position:absolute") }} 的元素。

+ +
+

警告:这个属性已被废弃。建议使用 {{cssxref("clip-path")}} 。

+
+ +

{{cssinfo}}

+ +

语法

+ +
形式语法: {{csssyntax("clip")}}
+
+ +
clip: rect(1px, 10em, 3rem, 2ch)
+clip: auto
+
+clip: inherit
+ +

+ +
+
<shape>
+
一个矩形 {{cssxref("<shape>")}} +
rect(<top>, <right>, <bottom>, <left>)   /* 标准语法 */
+
+ 或 + +
rect(<top> <right> <bottom> <left>)      /* 向后兼容语法 */
+ <top><bottom> 指定相对于盒子上边框边界 的偏移,<right><left> 指定了相对于盒子左边框边界 的偏移。
+
<top><right><bottom>, 和 <left> 的值可以是 {{cssxref("<length>")}} 值或 auto
+
auto
+
元素不裁剪(默认值)
+
+ +

示例

+ +
p { border:dotted;  position:relative; }
+
+#img2 {
+  position:absolute;  left:263px;
+
+  clip: rect(40px, 200px, 150px, 30px);
+  /* 标准语法,Internet Explorer 4-7 不支持 */
+}
+
+#img3 {
+  position: absolute; left:526px;
+
+  clip: rect(40px  200px  150px  30px);
+  /* 非标准语法,但是包括火狐与 IE 在内的主要浏览器均支持 */
+}
+ +

hut.jpg hut.jpg hut.jpg

+ +

规范

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{ SpecName('CSS3 Transitions', '#animatable-css', 'clip') }}{{ Spec2('CSS3 Transitions') }}Defines clip as animatable.
{{ SpecName('CSS2.1', 'visufx.html#clipping', 'clip') }}{{ Spec2('CSS2.1') }} 
+ +

浏览器兼容性

+ +

{{ CompatibilityTable() }}

+ +
+ + + + + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support1.01.0 (1.0)4.07.01.0 (85)
8.0
+ 该版本支持逗号语法。
+
+ +
+ + + + + + + + + + + + + + + + + + + +
FeatureAndroidFirefox Mobile (Gecko)IE PhoneOpera MobileSafari Mobile
Basic support{{ CompatUnknown() }}{{ CompatUnknown() }}{{ CompatUnknown() }}{{ CompatUnknown() }}{{ CompatUnknown() }}
+
+ +

See also

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