From d490e42ffe823173477b841ec397105bd06cb336 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Thu, 17 Jun 2021 13:35:36 -0400 Subject: rid of $samples iframes --- files/zh-cn/web/css/shape-image-threshold/index.html | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'files/zh-cn/web/css/shape-image-threshold') diff --git a/files/zh-cn/web/css/shape-image-threshold/index.html b/files/zh-cn/web/css/shape-image-threshold/index.html index 1f4daae524..923607a5e8 100644 --- a/files/zh-cn/web/css/shape-image-threshold/index.html +++ b/files/zh-cn/web/css/shape-image-threshold/index.html @@ -44,11 +44,13 @@ shape-image-threshold: unset; {{csssyntax}} -

范例

+

范例

+ +

Aligning text to a gradient

这个例子创建了一个{{HTMLElement("div")}}块,其背景是一个渐变图像。shape-outside也定义了一个渐变图像,以此创建一个CSS形状,渐变图像中不透明度至少为20%(即alpha值大于0.2)的像素都是形状的一部分。

-

HTML

+

HTML

<div id="gradient-shape"></div>
 
@@ -65,7 +67,7 @@ shape-image-threshold: unset;
   deleniti ipsum sequi rem eveniet laboriosam magni expedita?
 </p>
-

CSS

+

CSS

#gradient-shape {
   width: 150px;
@@ -82,9 +84,10 @@ shape-image-threshold: unset;
 
 

随后值为0.2shape-image-threshold属性规定渐变中不透明度超过20%的像素才参与构成形状。

-

Result

+

Result

+ +

{{EmbedLiveSample('Aligning_text_to_a_gradient', 600, 230)}}

-

规范

@@ -109,7 +112,7 @@ shape-image-threshold: unset;
-

{{Compat("css.properties.shape-image-threshold")}}

+

{{Compat}}

参见

-- cgit v1.2.3-54-g00ecf