From 5a4e84a38e4103df148c7e332bf2485e3779ef0e Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 28 May 2021 22:26:45 +0800 Subject: Update index.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 重拍应修改为重排。 --- files/zh-cn/web/css/css_containment/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'files/zh-cn') diff --git a/files/zh-cn/web/css/css_containment/index.html b/files/zh-cn/web/css/css_containment/index.html index a1f5c51af0..1b63d1f33a 100644 --- a/files/zh-cn/web/css/css_containment/index.html +++ b/files/zh-cn/web/css/css_containment/index.html @@ -28,7 +28,7 @@ translation_of: Web/CSS/CSS_Containment

在这个页面中,每个 article 都独立于其他的 article,所以,他们都被设置了 contain: content 属性,为了告诉浏览器他们相互独立。浏览器就可以通过这个信息来确定,如何渲染这些内容。比如,他可能不会渲染超出视图范围外的内容。

-

如果我们给每个 <article> 节点都设置其 contain 属性为 content, 当新的内容被加入到该节点中时,浏览器就知道不用重拍和重绘节点以外的页面内容,但如果 <article>  设置了其 CSS 属性能让其大小根据其内容改变(比如 height: auto), 浏览器依旧会进行其大小的计算。

+

如果我们给每个 <article> 节点都设置其 contain 属性为 content, 当新的内容被加入到该节点中时,浏览器就知道不用重排和重绘节点以外的页面内容,但如果 <article> 设置了其 CSS 属性能让其大小根据其内容改变(比如 height: auto), 浏览器依旧会进行其大小的计算。

我们通过 contain 属性告诉浏览器,这些节点是独立的。

-- cgit v1.2.3-54-g00ecf