From a02f4b2f60c81e09b318a090e5c9c2d2d641c878 Mon Sep 17 00:00:00 2001 From: t7yang Date: Sat, 17 Jul 2021 16:10:02 +0800 Subject: replace wiki links in zh-CN --- .../web/accessibility/aria/forms/alerts/index.html | 2 +- files/zh-cn/web/api/audiocontext/index.html | 2 +- .../canvas_api/tutorial/transformations/index.html | 2 +- .../canvasrenderingcontext2d/fillstyle/index.html | 2 +- .../web/api/canvasrenderingcontext2d/index.html | 2 +- .../linedashoffset/index.html | 2 +- files/zh-cn/web/api/css/index.html | 2 +- files/zh-cn/web/api/devicemotionevent/index.html | 2 +- .../web/api/document/onfullscreenchange/index.html | 4 +- .../api/document/visibilitychange_event/index.html | 2 +- files/zh-cn/web/api/element/classlist/index.html | 2 +- .../web/api/element/mousemove_event/index.html | 2 +- files/zh-cn/web/api/event/cancelable/index.html | 2 +- files/zh-cn/web/api/eventtarget/index.html | 2 +- .../web/api/extendableevent/waituntil/index.html | 4 +- .../zh-cn/web/api/fetch_api/using_fetch/index.html | 2 +- files/zh-cn/web/api/fullscreen_api/index.html | 2 +- files/zh-cn/web/api/history_api/index.html | 2 +- .../web/api/htmlanchorelement/hash/index.html | 2 +- files/zh-cn/web/api/htmlcanvaselement/index.html | 10 +-- files/zh-cn/web/api/htmlelement/nonce/index.html | 2 +- files/zh-cn/web/api/htmlimageelement/index.html | 2 +- .../htmlinputelement/setselectionrange/index.html | 2 +- .../zh-cn/web/api/htmlmediaelement/load/index.html | 2 +- .../zh-cn/web/api/htmlmediaelement/play/index.html | 12 +-- files/zh-cn/web/api/inputevent/data/index.html | 2 +- .../web/api/inputevent/datatransfer/index.html | 2 +- files/zh-cn/web/api/mediarecorder/index.html | 4 +- files/zh-cn/web/api/mouseevent/screeny/index.html | 2 +- .../using_navigation_timing/index.html | 4 +- files/zh-cn/web/api/navigator/canshare/index.html | 2 +- .../navigator/registerprotocolhandler/index.html | 4 +- files/zh-cn/web/api/node/textcontent/index.html | 12 +-- files/zh-cn/web/api/page_visibility_api/index.html | 8 +- files/zh-cn/web/api/pointer_events/index.html | 2 +- .../web/api/rtcpeerconnection/addtrack/index.html | 2 +- files/zh-cn/web/api/server-sent_events/index.html | 2 +- .../using_server-sent_events/index.html | 4 +- .../zh-cn/web/api/streams_api/concepts/index.html | 2 +- files/zh-cn/web/api/stylesheet/disabled/index.html | 2 +- files/zh-cn/web/api/touch/target/index.html | 2 +- files/zh-cn/web/api/url/index.html | 4 +- files/zh-cn/web/api/url/password/index.html | 2 +- files/zh-cn/web/api/url_api/index.html | 4 +- files/zh-cn/web/api/validitystate/index.html | 4 +- files/zh-cn/web/api/visualviewport/index.html | 8 +- files/zh-cn/web/api/webgl_api/index.html | 4 +- .../createrenderbuffer/index.html | 2 +- .../api/webrtc_api/taking_still_photos/index.html | 4 +- .../web/api/window/beforeunload_event/index.html | 2 +- .../web/api/window/devicepixelratio/index.html | 6 +- files/zh-cn/web/api/window/getselection/index.html | 2 +- .../web/api/window/requestidlecallback/index.html | 2 +- .../api/windoweventhandlers/onunload/index.html | 2 +- files/zh-cn/web/api/worker/index.html | 6 +- .../xmlhttprequest/getresponseheader/index.html | 2 +- files/zh-cn/web/css/@keyframes/index.html | 2 +- files/zh-cn/web/css/_colon_is/index.html | 6 +- files/zh-cn/web/css/_colon_required/index.html | 2 +- .../web/css/alternative_style_sheets/index.html | 2 +- .../web/css/border-bottom-left-radius/index.html | 2 +- files/zh-cn/web/css/box-shadow/index.html | 2 +- files/zh-cn/web/css/clip-path/index.html | 2 +- files/zh-cn/web/css/color/index.html | 4 +- files/zh-cn/web/css/color_value/index.html | 6 +- files/zh-cn/web/css/counter()/index.html | 6 +- files/zh-cn/web/css/counters()/index.html | 20 ++--- files/zh-cn/web/css/css_columns/index.html | 10 +-- .../aligning_items_in_a_flex_container/index.html | 10 +-- files/zh-cn/web/css/css_selectors/index.html | 20 ++--- files/zh-cn/web/css/display/index.html | 58 ++++++------- files/zh-cn/web/css/flex-grow/index.html | 6 +- .../web/css/gradient/linear-gradient()/index.html | 2 +- .../web/css/gradient/radial-gradient()/index.html | 8 +- .../layout_cookbook/contribute_a_recipe/index.html | 2 +- files/zh-cn/web/css/length/index.html | 2 +- files/zh-cn/web/css/list-style-type/index.html | 16 ++-- .../media_queries/using_media_queries/index.html | 2 +- files/zh-cn/web/css/place-items/index.html | 2 +- .../zh-cn/web/css/shorthand_properties/index.html | 2 +- files/zh-cn/web/css/specificity/index.html | 2 +- .../web/css/transform-function/matrix()/index.html | 2 +- .../css/transform-function/translatey()/index.html | 2 +- .../web/css/using_css_custom_properties/index.html | 2 +- files/zh-cn/web/css/width/index.html | 6 +- files/zh-cn/web/css/writing-mode/index.html | 4 +- files/zh-cn/web/css/z-index/index.html | 2 +- .../creating_and_triggering_events/index.html | 2 +- files/zh-cn/web/guide/ajax/index.html | 4 +- files/zh-cn/web/houdini/index.html | 8 +- files/zh-cn/web/html/attributes/index.html | 98 +++++++++++----------- files/zh-cn/web/html/element/audio/index.html | 48 +++++------ files/zh-cn/web/html/element/fieldset/index.html | 10 +-- files/zh-cn/web/html/element/form/index.html | 14 ++-- files/zh-cn/web/html/element/hgroup/index.html | 4 +- .../zh-cn/web/html/element/input/hidden/index.html | 2 +- files/zh-cn/web/html/element/input/index.html | 14 ++-- .../zh-cn/web/html/element/input/reset/index.html | 4 +- .../zh-cn/web/html/element/input/search/index.html | 2 +- files/zh-cn/web/html/element/link/index.html | 4 +- files/zh-cn/web/html/element/meta/index.html | 8 +- files/zh-cn/web/html/element/progress/index.html | 8 +- files/zh-cn/web/html/element/script/index.html | 4 +- files/zh-cn/web/html/element/select/index.html | 12 +-- files/zh-cn/web/html/element/style/index.html | 4 +- files/zh-cn/web/html/element/textarea/index.html | 10 +-- files/zh-cn/web/html/element/video/index.html | 2 +- .../html/global_attributes/data-_star_/index.html | 2 +- .../web/html/global_attributes/hidden/index.html | 2 +- files/zh-cn/web/http/cookies/index.html | 14 ++-- .../errors/corsmissingallowcredentials/index.html | 4 +- .../web/http/headers/cache-control/index.html | 2 +- files/zh-cn/web/http/headers/dpr/index.html | 2 +- .../http/headers/set-cookie/samesite/index.html | 4 +- files/zh-cn/web/http/redirections/index.html | 8 +- files/zh-cn/web/http/status/304/index.html | 2 +- files/zh-cn/web/javascript/closures/index.html | 2 +- .../regular_expressions/assertions/index.html | 14 ++-- .../web/javascript/reference/classes/index.html | 2 +- .../reference/functions/arguments/index.html | 4 +- .../reference/global_objects/bigint/index.html | 2 +- .../global_objects/bigint64array/index.html | 4 +- .../reference/global_objects/boolean/index.html | 4 +- .../global_objects/encodeuricomponent/index.html | 2 +- .../reference/global_objects/globalthis/index.html | 2 +- .../global_objects/math/random/index.html | 2 +- .../global_objects/object/assign/index.html | 2 +- .../global_objects/promise/allsettled/index.html | 6 +- .../reference/global_objects/reflect/index.html | 4 +- .../reference/global_objects/regexp/index.html | 2 +- .../reference/global_objects/set/index.html | 2 +- .../reference/operators/inequality/index.html | 12 +-- .../operators/optional_chaining/index.html | 2 +- .../javascript/reference/operators/this/index.html | 2 +- .../reference/statements/import/index.html | 2 +- files/zh-cn/web/mathml/element/mrow/index.html | 2 +- .../zh-cn/web/performance/dns-prefetch/index.html | 26 +++--- .../zh-cn/web/performance/lazy_loading/index.html | 2 +- .../add_to_home_screen/index.html | 4 +- .../turning_off_form_autocompletion/index.html | 2 +- .../web/svg/attribute/marker-start/index.html | 6 +- files/zh-cn/web/svg/element/animate/index.html | 4 +- files/zh-cn/web/xml/xml_introduction/index.html | 4 +- 143 files changed, 410 insertions(+), 410 deletions(-) (limited to 'files/zh-cn/web') diff --git a/files/zh-cn/web/accessibility/aria/forms/alerts/index.html b/files/zh-cn/web/accessibility/aria/forms/alerts/index.html index 485633647c..04e64237e0 100644 --- a/files/zh-cn/web/accessibility/aria/forms/alerts/index.html +++ b/files/zh-cn/web/accessibility/aria/forms/alerts/index.html @@ -99,7 +99,7 @@ translation_of: Web/Accessibility/ARIA/forms/alerts

addAlert 函数

-

此功能首先删除所有旧警报。 该函数很简单:它查找ID为“alert”的元素,如果找到,则将其从文档对象模型中删除。

+

此功能首先删除所有旧警报。 该函数很简单:它查找ID为“alert”的元素,如果找到,则将其从文档对象模型中删除。

接下来,这个函数创建一个div元素来保存警告文本。 它得到了一个 “alert”的ID.,并且它具有“alert”角色集。 这实际上是受ARIA启发的,即使它在属性名称中没有标明“aria”。 这是因为该角色基于XHTML角色属性模块,为简单起见,该模块简单地移植到HTML。

diff --git a/files/zh-cn/web/api/audiocontext/index.html b/files/zh-cn/web/api/audiocontext/index.html index b70d5feb56..eae53ceaa1 100644 --- a/files/zh-cn/web/api/audiocontext/index.html +++ b/files/zh-cn/web/api/audiocontext/index.html @@ -98,6 +98,6 @@ var finish = audioCtx.destination;

相关链接

diff --git a/files/zh-cn/web/api/canvas_api/tutorial/transformations/index.html b/files/zh-cn/web/api/canvas_api/tutorial/transformations/index.html index d8e65e4dc4..fea4e7e8fc 100644 --- a/files/zh-cn/web/api/canvas_api/tutorial/transformations/index.html +++ b/files/zh-cn/web/api/canvas_api/tutorial/transformations/index.html @@ -212,7 +212,7 @@ translation_of: Web/API/Canvas_API/Tutorial/Transformations
{{domxref("CanvasRenderingContext2D.transform", "transform(a, b, c, d, e, f)")}}
这个方法是将当前的变形矩阵乘上一个基于自身参数的矩阵,如下面的矩阵所示:[acebdf001]\left[ \begin{array}{ccc} a & c & e \\ b & d & f \\ 0 & 0 & 1 \end{array} \right]
-
如果任意一个参数是Infinity,变形矩阵也必须被标记为无限大,否则会抛出异常。
+
如果任意一个参数是Infinity,变形矩阵也必须被标记为无限大,否则会抛出异常。

这个函数的参数各自代表如下:

diff --git a/files/zh-cn/web/api/canvasrenderingcontext2d/fillstyle/index.html b/files/zh-cn/web/api/canvasrenderingcontext2d/fillstyle/index.html index 09f8a09480..33cd174f64 100644 --- a/files/zh-cn/web/api/canvasrenderingcontext2d/fillstyle/index.html +++ b/files/zh-cn/web/api/canvasrenderingcontext2d/fillstyle/index.html @@ -154,7 +154,7 @@ setFillColor(c, m, y, k, a);

参见

diff --git a/files/zh-cn/web/api/document/onfullscreenchange/index.html b/files/zh-cn/web/api/document/onfullscreenchange/index.html index 68c269c2a0..e012de078f 100644 --- a/files/zh-cn/web/api/document/onfullscreenchange/index.html +++ b/files/zh-cn/web/api/document/onfullscreenchange/index.html @@ -59,8 +59,8 @@ document.documentElement.onclick = function () {

相关文章

diff --git a/files/zh-cn/web/api/document/visibilitychange_event/index.html b/files/zh-cn/web/api/document/visibilitychange_event/index.html index f1c945c5ea..a2099d511b 100644 --- a/files/zh-cn/web/api/document/visibilitychange_event/index.html +++ b/files/zh-cn/web/api/document/visibilitychange_event/index.html @@ -33,7 +33,7 @@ translation_of: Web/API/Document/visibilitychange_event

该事件不包括文档的更新的可见性状态,但是您可以从文档的  {{domxref("Document.visibilityState", "visibilityState")}} 属性中获取该信息。

-

当 visibleStateState 属性的值转换为 hidden 时,Safari不会按预期触发visibilitychange; 因此,在这种情况下,您还需要包含代码以侦听 pagehide 事件。

+

当 visibleStateState 属性的值转换为 hidden 时,Safari不会按预期触发visibilitychange; 因此,在这种情况下,您还需要包含代码以侦听 pagehide 事件。

diff --git a/files/zh-cn/web/api/element/classlist/index.html b/files/zh-cn/web/api/element/classlist/index.html index 4cd64f9d9f..194b627074 100644 --- a/files/zh-cn/web/api/element/classlist/index.html +++ b/files/zh-cn/web/api/element/classlist/index.html @@ -24,7 +24,7 @@ translation_of: Web/API/Element/classList

返回值

-

elementClasses 是一个 {{domxref("DOMTokenList")}} 表示  elementNodeReference 的类属性 。如果类属性未设置或为空,那么 elementClasses.length 返回 0。虽然 element.classList 本身是只读的,但是你可以使用 add() 和 remove() 方法修改它。

+

elementClasses 是一个 {{domxref("DOMTokenList")}} 表示  elementNodeReference 的类属性 。如果类属性未设置或为空,那么 elementClasses.length 返回 0。虽然 element.classList 本身是只读的,但是你可以使用 add() 和 remove() 方法修改它。

示例

diff --git a/files/zh-cn/web/api/element/mousemove_event/index.html b/files/zh-cn/web/api/element/mousemove_event/index.html index a6aace0933..f549324971 100644 --- a/files/zh-cn/web/api/element/mousemove_event/index.html +++ b/files/zh-cn/web/api/element/mousemove_event/index.html @@ -41,7 +41,7 @@ translation_of: Web/API/Element/mousemove_event

例子

-

下面的例子将使用 {{domxref("Element/mousedown_event", "mousedown")}}, mousemove 以及 {{domxref("Element/mouseup_event", "mouseup")}} 事件,实现一个允许用户在 HTML5 canvas绘图的功能。这个例子的功能很简单:线的粗细设置为1,颜色始终为黑色。

+

下面的例子将使用 {{domxref("Element/mousedown_event", "mousedown")}}, mousemove 以及 {{domxref("Element/mouseup_event", "mouseup")}} 事件,实现一个允许用户在 HTML5 canvas绘图的功能。这个例子的功能很简单:线的粗细设置为1,颜色始终为黑色。

当页面加载完成,我们使用变量 myPics 和context分别保存ID为myPics的DOM元素和接下来需要加工的的2d元素。

diff --git a/files/zh-cn/web/api/event/cancelable/index.html b/files/zh-cn/web/api/event/cancelable/index.html index 260da1a336..a7433f1e4e 100644 --- a/files/zh-cn/web/api/event/cancelable/index.html +++ b/files/zh-cn/web/api/event/cancelable/index.html @@ -11,7 +11,7 @@ translation_of: Web/API/Event/cancelable

大部分由用户与页面交互产生的原生浏览器事件都可以被取消。取消{{event("click")}},{{event("scroll")}} 或 {{event("beforeunload")}} 事件将分别阻止用户点击某些元素,滚动页面或跳离页面。

-

使用其它 JavaScript 代码创建的 Custom events ,可以在初始化事件的时候控制该事件是否可以被取消。

+

使用其它 JavaScript 代码创建的 Custom events ,可以在初始化事件的时候控制该事件是否可以被取消。

语法

diff --git a/files/zh-cn/web/api/eventtarget/index.html b/files/zh-cn/web/api/eventtarget/index.html index 3793a8b749..8d22342e6b 100644 --- a/files/zh-cn/web/api/eventtarget/index.html +++ b/files/zh-cn/web/api/eventtarget/index.html @@ -14,7 +14,7 @@ translation_of: Web/API/EventTarget

{{domxref("Element")}},{{domxref("document")}} 和 {{domxref("window")}} 是最常见的 event targets ,但是其他对象也可以作为 event targets,比如 {{domxref("XMLHttpRequest")}},{{domxref("AudioNode")}},{{domxref("AudioContext")}}  等等。

-

许多 event targets (包括 elements, documents 和 windows)支持通过 onevent 特性和属性设置事件处理程序 (event handlers)。

+

许多 event targets (包括 elements, documents 和 windows)支持通过 onevent 特性和属性设置事件处理程序 (event handlers)。

{{InheritanceDiagram}}

diff --git a/files/zh-cn/web/api/extendableevent/waituntil/index.html b/files/zh-cn/web/api/extendableevent/waituntil/index.html index 8e48586b67..919ceac2c6 100644 --- a/files/zh-cn/web/api/extendableevent/waituntil/index.html +++ b/files/zh-cn/web/api/extendableevent/waituntil/index.html @@ -7,9 +7,9 @@ translation_of: Web/API/ExtendableEvent/waitUntil

ExtendableEvent.waitUntil() 方法告诉事件分发器该事件仍在进行。这个方法也可以用于检测进行的任务是否成功。在服务工作线程中,这个方法告诉浏览器事件一直进行,直至 promise 解决,浏览器不应该在事件中的异步操作完成之前终止服务工作线程。

-

服务工作线程(service workers)中的 {{domxref("ServiceWorkerGlobalScope/install_event", "install")}} 事件使用 waitUntil() 来将服务工作线程保持在 {{domxref("ServiceWorkerRegistration.installing", "installing")}} 阶段。如果传入 waitUntil() 的 promise 被拒绝,则将此次安装视为失败,丢弃这个服务工作线程。这主要用于确保在服务工作线程安装以前,所有依赖的核心缓存都已经成功载入。

+

服务工作线程(service workers)中的 {{domxref("ServiceWorkerGlobalScope/install_event", "install")}} 事件使用 waitUntil() 来将服务工作线程保持在 {{domxref("ServiceWorkerRegistration.installing", "installing")}} 阶段。如果传入 waitUntil() 的 promise 被拒绝,则将此次安装视为失败,丢弃这个服务工作线程。这主要用于确保在服务工作线程安装以前,所有依赖的核心缓存都已经成功载入。

-

服务工作线程(service workers)中的 {{domxref("ServiceWorkerGlobalScope/activate_event", "activate")}} 事件使用 waitUntil() 来延迟函数事件,如 fetch 和 push,直至传入 waitUntil() 的 promise 被解决。这让服务工作线程有时间更新数据库架构(database schema)和删除过时缓存({{domxref("Cache", "caches")}}),让其他事件能在一个完成更新的状态下进行。

+

服务工作线程(service workers)中的 {{domxref("ServiceWorkerGlobalScope/activate_event", "activate")}} 事件使用 waitUntil() 来延迟函数事件,如 fetch 和 push,直至传入 waitUntil() 的 promise 被解决。这让服务工作线程有时间更新数据库架构(database schema)和删除过时缓存({{domxref("Cache", "caches")}}),让其他事件能在一个完成更新的状态下进行。

 waitUntil() 方法最初必须在事件回调里调用,在此之后,方法可以被调用多次,直至所有传入的 promise 被解决。

diff --git a/files/zh-cn/web/api/fetch_api/using_fetch/index.html b/files/zh-cn/web/api/fetch_api/using_fetch/index.html index eb8f12659b..d08d605958 100644 --- a/files/zh-cn/web/api/fetch_api/using_fetch/index.html +++ b/files/zh-cn/web/api/fetch_api/using_fetch/index.html @@ -20,7 +20,7 @@ translation_of: Web/API/Fetch_API/Using_Fetch diff --git a/files/zh-cn/web/api/fullscreen_api/index.html b/files/zh-cn/web/api/fullscreen_api/index.html index 59bea9a990..87e6fec637 100644 --- a/files/zh-cn/web/api/fullscreen_api/index.html +++ b/files/zh-cn/web/api/fullscreen_api/index.html @@ -117,7 +117,7 @@ translation_of: Web/API/Fullscreen_API

全屏模式可由功能策略( Feature Policy)控制。全屏模式功能由字符串“full screen”标识,默认的允许列表值为“self”,这意味着在顶级文档上下文 以及 从与顶级文档相同的源加载的嵌套上下文中允许使用全屏模式。

-

请参阅使用功能策略( Feature Policy )以了解有关使用功能策略控制对API的访问的更多信息。

+

请参阅使用功能策略( Feature Policy )以了解有关使用功能策略控制对API的访问的更多信息。

使用说明

diff --git a/files/zh-cn/web/api/history_api/index.html b/files/zh-cn/web/api/history_api/index.html index 2c4edffce9..c7e54a41b3 100644 --- a/files/zh-cn/web/api/history_api/index.html +++ b/files/zh-cn/web/api/history_api/index.html @@ -209,5 +209,5 @@ history.pushState(stateObj, "page 2", "bar.html");

Guides

diff --git a/files/zh-cn/web/api/htmlanchorelement/hash/index.html b/files/zh-cn/web/api/htmlanchorelement/hash/index.html index 5f9305da09..257a572947 100644 --- a/files/zh-cn/web/api/htmlanchorelement/hash/index.html +++ b/files/zh-cn/web/api/htmlanchorelement/hash/index.html @@ -10,7 +10,7 @@ original_slug: Web/API/HTMLHyperlinkElementUtils/hash

HTMLHyperlinkElementUtils.hash 属性返回一个包含“#”的 {{domxref("DOMString")}} , 后跟URL的片段标识符。

-

片段没有百分比解码。如果URL没有包含片段标识符,这个属性为一个空的字符串, "".

+

片段没有百分比解码。如果URL没有包含片段标识符,这个属性为一个空的字符串, "".

Syntax

diff --git a/files/zh-cn/web/api/htmlcanvaselement/index.html b/files/zh-cn/web/api/htmlcanvaselement/index.html index b5efafdf5b..75396fc50c 100644 --- a/files/zh-cn/web/api/htmlcanvaselement/index.html +++ b/files/zh-cn/web/api/htmlcanvaselement/index.html @@ -32,7 +32,7 @@ translation_of: Web/API/HTMLCanvasElement
{{domxref("HTMLCanvasElement.captureStream()")}} {{experimental_inline}}
返回{{domxref("CanvasCaptureMediaStream")}} ,它是对画布表面的实时视频捕获。
{{domxref("HTMLCanvasElement.getContext()")}}
-
返回画布上的绘图上下文;如果不支持上下文ID,则返回null。 绘图上下文可让您在画布上绘图。 调用getContext传入"2d" 可以返回一个{{domxref("CanvasRenderingContext2D")}}对象,也可以传入"webgl"(或"experimental-webgl")返回一个{{domxref("WebGLRenderingContext")}} 对象。 此上下文仅在实现WebGL的浏览器上可用。
+
返回画布上的绘图上下文;如果不支持上下文ID,则返回null。 绘图上下文可让您在画布上绘图。 调用getContext传入"2d" 可以返回一个{{domxref("CanvasRenderingContext2D")}}对象,也可以传入"webgl"(或"experimental-webgl")返回一个{{domxref("WebGLRenderingContext")}} 对象。 此上下文仅在实现WebGL的浏览器上可用。
{{domxref("HTMLCanvasElement.toDataURL()")}}
返回一个数据URL,该URL包含由类型参数指定的格式的图像(默认为png)。 返回的图像分辨率为96dpi。
{{domxref("HTMLCanvasElement.toBlob()")}}
@@ -48,14 +48,14 @@ translation_of: Web/API/HTMLCanvasElement

事件

-

使用addEventListener()监听这些事件。

+

使用addEventListener()监听这些事件。

-
webglcontextcreationerror
+
webglcontextcreationerror
如果用户代理无法创建WebGLRenderingContext 或WebGL2RenderingContext 上下文,则触发该事件。
-
webglcontextlost
+
webglcontextlost
如果用户代理检测到与WebGLRenderingContext 或WebGL2RenderingContext 对象关联的绘图缓冲区已丢失,则触发此事件。
-
webglcontextrestored
+
webglcontextrestored
如果用户代理为WebGLRenderingContext 或WebGL2RenderingContext 对象恢复绘图缓冲区,则触发该事件。
diff --git a/files/zh-cn/web/api/htmlelement/nonce/index.html b/files/zh-cn/web/api/htmlelement/nonce/index.html index 018a276376..0e427038a4 100644 --- a/files/zh-cn/web/api/htmlelement/nonce/index.html +++ b/files/zh-cn/web/api/htmlelement/nonce/index.html @@ -26,7 +26,7 @@ HTMLElement.nonce = nonce

访问nonce属性值

-

以前,并不是所有的浏览器都支持 nonce IDL属性,因此在实际应用场景中,尝试使用getAttribute 作为备选:

+

以前,并不是所有的浏览器都支持 nonce IDL属性,因此在实际应用场景中,尝试使用getAttribute 作为备选:

let nonce = script['nonce'] || script.getAttribute('nonce');
diff --git a/files/zh-cn/web/api/htmlimageelement/index.html b/files/zh-cn/web/api/htmlimageelement/index.html index 19ae9dd455..bf35d8b582 100644 --- a/files/zh-cn/web/api/htmlimageelement/index.html +++ b/files/zh-cn/web/api/htmlimageelement/index.html @@ -29,7 +29,7 @@ translation_of: Web/API/HTMLImageElement
一个 {{domxref("DOMString")}} 表示这个img元素的 CORS 设置。参考 CORS settings attributes。This may be null if CORS is not used.
{{domxref("HTMLImageElement.currentSrc")}} {{readonlyInline}}
返回一个 {{domxref("DOMString")}}  表示加载当前显示的图像的URL。
- 这可能会改变,因为图像是调整,由于不断变化的条件,由任何 media queries 的地方。
+ 这可能会改变,因为图像是调整,由于不断变化的条件,由任何 media queries 的地方。
{{domxref("HTMLImageElement.decoding")}}
An optional {{domxref("DOMString")}} representing a hint given to the browser on how it should decode the image. If this value is provided, it must be one of the possible permitted values: sync to decode the image synchronously, async to decode it asynchronously, or auto to indicate no preference (which is the default). Read the {{domxref("HTMLImageElement.decoding", "decoding")}} page for details on the implications of this property's values.
{{domxref("HTMLImageElement.height")}}
diff --git a/files/zh-cn/web/api/htmlinputelement/setselectionrange/index.html b/files/zh-cn/web/api/htmlinputelement/setselectionrange/index.html index 0d7070858d..b571e8cf9a 100644 --- a/files/zh-cn/web/api/htmlinputelement/setselectionrange/index.html +++ b/files/zh-cn/web/api/htmlinputelement/setselectionrange/index.html @@ -20,7 +20,7 @@ translation_of: Web/API/HTMLInputElement/setSelectionRange

要注意的是,在 WHATWG forms spec 中,selectionStartselectionEnd 属性和 setSelectionRange 方法只能应用于类型为文本、搜索、链接、电话号码和密码的输入。Chrome 从版本 33 开始会在访问其余类型的这些属性和方法时抛出异常。例如,输入类型为数字时会抛出:“不能从'HTMLInputElement'中读取'selectionStart'属性:输入元素的类型('number')不支持选择(Failed to read the 'selectionStart' property from 'HTMLInputElement': The input element's type ('number') does not support selection)”。

-

如果你希望全选输入元素中的文本,你可以使用 HTMLInputElement.select() 方法。

+

如果你希望全选输入元素中的文本,你可以使用 HTMLInputElement.select() 方法。

语法

diff --git a/files/zh-cn/web/api/htmlmediaelement/load/index.html b/files/zh-cn/web/api/htmlmediaelement/load/index.html index eb674466d9..9f3d3c4496 100644 --- a/files/zh-cn/web/api/htmlmediaelement/load/index.html +++ b/files/zh-cn/web/api/htmlmediaelement/load/index.html @@ -23,7 +23,7 @@ translation_of: Web/API/HTMLMediaElement/load

用法

-

调用 load() 会使媒体上所有正在进行的操作中止,然后根据 audio 或者 video 元素的 src 或者 source 属性里寻找合适的播放源并重新加载媒体内容。 更多查看  Supporting multiple formats 和 Video and audio content 。

+

调用 load() 会使媒体上所有正在进行的操作中止,然后根据 audio 或者 video 元素的 src 或者 source 属性里寻找合适的播放源并重新加载媒体内容。 更多查看  Supporting multiple formats 和 Video and audio content 。

The process of aborting any ongoing activities will cause any outstanding {{jsxref("Promise")}}s returned by {{domxref("HTMLMediaElement.play", "play()")}} being resolved or rejected as appropriate based on their status before the loading of new media can begin. Pending play promises are aborted with an "AbortError" {{domxref("DOMException")}}.

diff --git a/files/zh-cn/web/api/htmlmediaelement/play/index.html b/files/zh-cn/web/api/htmlmediaelement/play/index.html index 6f0b799471..e492d4581e 100644 --- a/files/zh-cn/web/api/htmlmediaelement/play/index.html +++ b/files/zh-cn/web/api/htmlmediaelement/play/index.html @@ -56,7 +56,7 @@ translation_of: Web/API/HTMLMediaElement/play

注意:play() 方法可能会让用户被询问是否给予播放媒体的权限,这可能会使返回的 promise 延迟解决。你应该确保你的代码不需要即时响应。

-

关于自动播放和禁止自动播放的更多深度内容,参见我们的文章 Autoplay guide for media and Web Audio APIs

+

关于自动播放和禁止自动播放的更多深度内容,参见我们的文章 Autoplay guide for media and Web Audio APIs

示例

@@ -86,7 +86,7 @@ function handlePlayButton() { } } -

在这个例子中,视频的播放由 async playVideo() 函数控制。函数尝试播放视频,如果播放成功,将 playButton 元素的类名称设为 "playing"。如果播放失败,去除 playButton 元素的类名称,恢复其原来的样式。通过监视 play() 返回的 {{jsxref("Promise")}} 是被解决还是被拒绝以保证播放按钮的外观与实际的播放状态相匹配。

+

在这个例子中,视频的播放由 async playVideo() 函数控制。函数尝试播放视频,如果播放成功,将 playButton 元素的类名称设为 "playing"。如果播放失败,去除 playButton 元素的类名称,恢复其原来的样式。通过监视 play() 返回的 {{jsxref("Promise")}} 是被解决还是被拒绝以保证播放按钮的外观与实际的播放状态相匹配。

上述代码开始执行时,先获取 {{HTMLElement("video")}} 元素和用于切换播放、暂停的 {{HTMLElement("button")}} 元素的引用。在切换按钮上添加 {{event("click")}} 事件的处理程序。最后调用 playVideo() 尝试自动开始播放。

@@ -125,10 +125,10 @@ function handlePlayButton() {

参见

diff --git a/files/zh-cn/web/api/inputevent/data/index.html b/files/zh-cn/web/api/inputevent/data/index.html index 0b1259df38..fc88ca7c42 100644 --- a/files/zh-cn/web/api/inputevent/data/index.html +++ b/files/zh-cn/web/api/inputevent/data/index.html @@ -26,7 +26,7 @@ translation_of: Web/API/InputEvent/data

示例

-

在下面的简单示例中,我们在 input 事件上设置了一个事件监听器,以便在对 {{htmlelement("input")}} 元素的内容进行任何更改时(通过键入或粘贴),通过 InputEvent.data 属性检索添加的文本,并在 <input> 下面的段落中报告。

+

在下面的简单示例中,我们在 input 事件上设置了一个事件监听器,以便在对 {{htmlelement("input")}} 元素的内容进行任何更改时(通过键入或粘贴),通过 InputEvent.data 属性检索添加的文本,并在 <input> 下面的段落中报告。

<p>Some text to copy and paste.</p>
 
diff --git a/files/zh-cn/web/api/inputevent/datatransfer/index.html b/files/zh-cn/web/api/inputevent/datatransfer/index.html
index 680c567b7f..80699e5fd9 100644
--- a/files/zh-cn/web/api/inputevent/datatransfer/index.html
+++ b/files/zh-cn/web/api/inputevent/datatransfer/index.html
@@ -22,7 +22,7 @@ translation_of: Web/API/InputEvent/dataTransfer
 
 

示例

-

在下面的简单示例中,我们在 input 事件上设置了一个事件监听器,以便在将任何内容粘贴到 {{htmlelement("p")}} 元素时,通过 InputEvent.dataTransfer.getData() 方法检索其HTML源代码,并在输入框下面的段落中报告。

+

在下面的简单示例中,我们在 input 事件上设置了一个事件监听器,以便在将任何内容粘贴到 {{htmlelement("p")}} 元素时,通过 InputEvent.dataTransfer.getData() 方法检索其HTML源代码,并在输入框下面的段落中报告。

尝试复制并粘贴提供的部分内容以查看效果。注意,部分浏览器对其支持不佳。

diff --git a/files/zh-cn/web/api/mediarecorder/index.html b/files/zh-cn/web/api/mediarecorder/index.html index 5f42134e79..369e6dd27d 100644 --- a/files/zh-cn/web/api/mediarecorder/index.html +++ b/files/zh-cn/web/api/mediarecorder/index.html @@ -84,9 +84,9 @@ translation_of: Web/API/MediaRecorder

Listen to these events using addEventListener() or by assigning an event listener to the oneventname property of this interface.

-
error
+
error
Fired when an error occurs: for example because recording wasn't allowed or was attempted using an unsupported codec.
- Also available via the onerror property.
+ Also available via the onerror property.
diff --git a/files/zh-cn/web/api/mouseevent/screeny/index.html b/files/zh-cn/web/api/mouseevent/screeny/index.html index 4286534635..c90e1708d2 100644 --- a/files/zh-cn/web/api/mouseevent/screeny/index.html +++ b/files/zh-cn/web/api/mouseevent/screeny/index.html @@ -11,7 +11,7 @@ translation_of: Web/API/MouseEvent/screenY ---

{{APIRef("DOM Events")}}

-

 screenX 是 MouseEvent 的只读属性,提供鼠标在全局(屏幕)中的水平坐标(偏移量)。

+

 screenX 是 MouseEvent 的只读属性,提供鼠标在全局(屏幕)中的水平坐标(偏移量)。

语法

diff --git a/files/zh-cn/web/api/navigation_timing_api/using_navigation_timing/index.html b/files/zh-cn/web/api/navigation_timing_api/using_navigation_timing/index.html index 6f8c12dcf9..c2a1a1c2a3 100644 --- a/files/zh-cn/web/api/navigation_timing_api/using_navigation_timing/index.html +++ b/files/zh-cn/web/api/navigation_timing_api/using_navigation_timing/index.html @@ -46,7 +46,7 @@ translation_of: Web/API/Navigation_timing_API/Using_Navigation_Timing

列出的值适用于上面展示了示例的{{HTMLElement("iframe")}}。

-

你可以在{{domxref("PerformanceTiming")}}中查找可用的计时值的列表,请参见{{domxref("PerformanceTiming")}}接口的“属性”部分。

+

你可以在{{domxref("PerformanceTiming")}}中查找可用的计时值的列表,请参见{{domxref("PerformanceTiming")}}接口的“属性”部分。

确定导航类型

@@ -114,7 +114,7 @@ translation_of: Web/API/Navigation_timing_API/Using_Navigation_Timing

也可以看看

diff --git a/files/zh-cn/web/api/navigator/canshare/index.html b/files/zh-cn/web/api/navigator/canshare/index.html index 9fe117805d..6f807819d7 100644 --- a/files/zh-cn/web/api/navigator/canshare/index.html +++ b/files/zh-cn/web/api/navigator/canshare/index.html @@ -7,7 +7,7 @@ translation_of: Web/API/Navigator/canShare
-
如果对Navigator.share() 的调用成功,则Web Share API的Navigator.canShare()方法将返回true。
+
如果对Navigator.share() 的调用成功,则Web Share API的Navigator.canShare()方法将返回true。

语法

diff --git a/files/zh-cn/web/api/navigator/registerprotocolhandler/index.html b/files/zh-cn/web/api/navigator/registerprotocolhandler/index.html index b51348f2ef..fd1de837c9 100644 --- a/files/zh-cn/web/api/navigator/registerprotocolhandler/index.html +++ b/files/zh-cn/web/api/navigator/registerprotocolhandler/index.html @@ -35,7 +35,7 @@ translation_of: Web/API/Navigator/registerProtocolHandler
url
-
处理器的URL,string类型。这个字符串应该包含一个"%s"的占位符,其会被将要受理的文档的 escaped 链接所替换。这个链接(译者按:指将要受理的文档的 escaped 链接,也就是替换占位符的字符串)可能是一个真实的URL,或者是一个电话号码,邮件地址之类的。
+
处理器的URL,string类型。这个字符串应该包含一个"%s"的占位符,其会被将要受理的文档的 escaped 链接所替换。这个链接(译者按:指将要受理的文档的 escaped 链接,也就是替换占位符的字符串)可能是一个真实的URL,或者是一个电话号码,邮件地址之类的。
这个处理器的 URL 必须以 http 或者 https 协议标记作为开头,最好是 https ,以满足一些浏览器出于安全考虑的要求。
@@ -53,7 +53,7 @@ translation_of: Web/API/Navigator/registerProtocolHandler
  • 指定了一个非法的协议标记,例如一个浏览器自身的标记(https:about: 等)。
  • -
  • 处理器URL的 origin 与调用这个API的页面的 origin不匹配。
  • +
  • 处理器URL的 origin 与调用这个API的页面的 origin不匹配。
  • 浏览器要求这个函数由安全的上下文调用。
  • 浏览器要求处理器的URL使用 HTTPS 协议。
diff --git a/files/zh-cn/web/api/node/textcontent/index.html b/files/zh-cn/web/api/node/textcontent/index.html index 1a2cd275e7..d9b4f26e86 100644 --- a/files/zh-cn/web/api/node/textcontent/index.html +++ b/files/zh-cn/web/api/node/textcontent/index.html @@ -13,7 +13,7 @@ translation_of: Web/API/Node/textContent

{{domxref ("Node")}} 接口的 textContent 属性表示一个节点及其后代的文本内容。

-

注意: textContent 和 {{domxref("HTMLElement.innerText")}} 容易混淆,但这两个属性在重要方面有不同之处 。

+

注意: textContent 和 {{domxref("HTMLElement.innerText")}} 容易混淆,但这两个属性在重要方面有不同之处 。

语法

@@ -30,13 +30,13 @@ translation_of: Web/API/Node/textContent

textContent 的值取决于具体情况:

    -
  • 如果节点是一个 {{domxref("document")}},或者一个 DOCTYPE ,则 textContent 返回 null。 +
  • 如果节点是一个 {{domxref("document")}},或者一个 DOCTYPE ,则 textContent 返回 null
    -

    如果你要获取整个文档的文本以及 CDATA data ,可以使用 document.documentElement.textContent

    +

    如果你要获取整个文档的文本以及 CDATA data ,可以使用 document.documentElement.textContent

  • -
  • 如果节点是个 CDATA section、注释、processing instruction 或者 text nodetextContent 返回节点内部的文本内容,例如 {{domxref("Node.nodeValue")}}。
  • +
  • 如果节点是个 CDATA section、注释、processing instruction 或者 text nodetextContent 返回节点内部的文本内容,例如 {{domxref("Node.nodeValue")}}。
  • 对于其他节点类型,textContent 将所有子节点的 textContent 合并后返回,除了注释和processing instructions。(如果该节点没有子节点的话,返回一个空字符串。)
@@ -50,7 +50,7 @@ translation_of: Web/API/Node/textContent
  • textContent 会获取所有元素的内容,包括 {{HTMLElement("script")}} 和 {{HTMLElement("style")}} 元素,然而 innerText 只展示给人看的元素。
  • textContent 会返回节点中的每一个元素。相反,innerText 受 CSS 样式的影响,并且不会返回隐藏元素的文本,
      -
    • 此外,由于 innerText 受 CSS 样式的影响,它会触发回流( reflow )去确保是最新的计算样式。(回流在计算上可能会非常昂贵,因此应尽可能避免。)
    • +
    • 此外,由于 innerText 受 CSS 样式的影响,它会触发回流( reflow )去确保是最新的计算样式。(回流在计算上可能会非常昂贵,因此应尽可能避免。)
  • 与 textContent 不同的是, 在 Internet Explorer (小于和等于 11 的版本) 中对 innerText 进行修改, 不仅会移除当前元素的子节点,而且还会永久性地破坏所有后代文本节点。在之后不可能再次将节点再次插入到任何其他元素或同一元素中。
  • @@ -60,7 +60,7 @@ translation_of: Web/API/Node/textContent

    正如其名称,{{domxref("Element.innerHTML")}} 返回 HTML。通常,为了在元素中检索或写入文本,人们使用 innerHTML。但是,textContent 通常具有更好的性能,因为文本不会被解析为HTML。

    -

    此外,使用 textContent 可以防止 XSS 攻击

    +

    此外,使用 textContent 可以防止 XSS 攻击

    例子

    diff --git a/files/zh-cn/web/api/page_visibility_api/index.html b/files/zh-cn/web/api/page_visibility_api/index.html index 383b0304bd..55e8f2c211 100644 --- a/files/zh-cn/web/api/page_visibility_api/index.html +++ b/files/zh-cn/web/api/page_visibility_api/index.html @@ -42,11 +42,11 @@ translation_of: Web/API/Page_Visibility_API
    • 大多数浏览器不会调用被隐藏的标签页或{{ HTMLElement("iframe") }}框架当中{{domxref("Window.requestAnimationFrame", "requestAnimationFrame()")}}定义的回调函数,这会提升性能并且延长电池的使用寿命。
    • -
    • 在调用被隐藏的标签页或iframe框架中 {{domxref("WindowOrWorkerGlobalScope.setTimeout", "setTimeout()")}}等计时器会被加速。 See Reasons for delays longer than specified for more details.
    • +
    • 在调用被隐藏的标签页或iframe框架中 {{domxref("WindowOrWorkerGlobalScope.setTimeout", "setTimeout()")}}等计时器会被加速。 See Reasons for delays longer than specified for more details.
    • Budget-based background timeout throttling is now available in modern browsers (Firefox 58+, Chrome 57+), placing an additional limit on background timer CPU usage. This operates in a similar way across modern browsers, with the details being as follows:
      • In Firefox, windows in background tabs each have their own time budget in milliseconds — a max and a min value of +50 ms and -150 ms, respectively. Chrome is very similar except that the budget is specified in seconds.
      • -
      • Windows are subjected to throttling after 30 seconds, with the same throttling delay rules as specified for window timers (again, see Reasons for delays longer than specified). In Chrome, this value is 10 seconds.
      • +
      • Windows are subjected to throttling after 30 seconds, with the same throttling delay rules as specified for window timers (again, see Reasons for delays longer than specified). In Chrome, this value is 10 seconds.
      • Timer tasks are only permitted when the budget is non-negative.
      • Once a timer's code has finished running, the duration of time it took to execute is subtracted from its window's timeout budget.
      • The budget regenerates at a rate of 10 ms per second, in both Firefox and Chrome.
      • @@ -58,8 +58,8 @@ translation_of: Web/API/Page_Visibility_API
        • Tabs which are playing audio are considered foreground and aren’t throttled.
        • -
        • Tabs running code that's using real-time network connections (WebSockets and WebRTC) go unthrottled in order to avoid closing these connections timing out and getting unexpectedly closed.
        • -
        • IndexedDB processes are also left unthrottled in order to avoid timeouts.
        • +
        • Tabs running code that's using real-time network connections (WebSockets and WebRTC) go unthrottled in order to avoid closing these connections timing out and getting unexpectedly closed.
        • +
        • IndexedDB processes are also left unthrottled in order to avoid timeouts.

        示例

        diff --git a/files/zh-cn/web/api/pointer_events/index.html b/files/zh-cn/web/api/pointer_events/index.html index 2a00f157a4..ee402fa91a 100644 --- a/files/zh-cn/web/api/pointer_events/index.html +++ b/files/zh-cn/web/api/pointer_events/index.html @@ -22,7 +22,7 @@ translation_of: Web/API/Pointer_events
        active buttons state
        -
        The condition when a pointer has a non-zero value for the buttons property. For example, in the case of a pen, when the pen has physical contact with the digitizer, or at least one button is depressed while hovering.
        +
        The condition when a pointer has a non-zero value for the buttons property. For example, in the case of a pen, when the pen has physical contact with the digitizer, or at least one button is depressed while hovering.
        diff --git a/files/zh-cn/web/api/rtcpeerconnection/addtrack/index.html b/files/zh-cn/web/api/rtcpeerconnection/addtrack/index.html index df295671eb..024fd5d0ed 100644 --- a/files/zh-cn/web/api/rtcpeerconnection/addtrack/index.html +++ b/files/zh-cn/web/api/rtcpeerconnection/addtrack/index.html @@ -148,7 +148,7 @@ pc.ontrack = ev => {

        实例

        -

        这个例子是从文章中给出的Signaling and video calling及其相应的示例代码中提取的。它来自那里的handleVideoOfferMsg()方法,该方法在从远程对等方接收到报价消息时被调用。

        +

        这个例子是从文章中给出的Signaling and video calling及其相应的示例代码中提取的。它来自那里的handleVideoOfferMsg()方法,该方法在从远程对等方接收到报价消息时被调用。

        var mediaConstraints = {
           audio: true,            // We want an audio track
        diff --git a/files/zh-cn/web/api/server-sent_events/index.html b/files/zh-cn/web/api/server-sent_events/index.html
        index a6e44fee83..0f3324ec7d 100644
        --- a/files/zh-cn/web/api/server-sent_events/index.html
        +++ b/files/zh-cn/web/api/server-sent_events/index.html
        @@ -11,7 +11,7 @@ original_slug: Server-sent_events
         ---
         
        {{DefaultAPISidebar("Server Sent Events")}}
        -

        一个网页获取新的数据通常需要发送一个请求到服务器,也就是向服务器请求的页面。使用 server-sent 事件,服务器可以在任何时刻向我们的 Web 页面推送数据和信息。这些被推送进来的信息可以在这个页面上作为 Events + data 的形式来处理。

        +

        一个网页获取新的数据通常需要发送一个请求到服务器,也就是向服务器请求的页面。使用 server-sent 事件,服务器可以在任何时刻向我们的 Web 页面推送数据和信息。这些被推送进来的信息可以在这个页面上作为 Events + data 的形式来处理。

        概念与使用

        diff --git a/files/zh-cn/web/api/server-sent_events/using_server-sent_events/index.html b/files/zh-cn/web/api/server-sent_events/using_server-sent_events/index.html index 5665f55722..fe30961b9f 100644 --- a/files/zh-cn/web/api/server-sent_events/using_server-sent_events/index.html +++ b/files/zh-cn/web/api/server-sent_events/using_server-sent_events/index.html @@ -100,7 +100,7 @@ while (true) {

        错误处理

        -

        当发生错误(例如请求超时或与HTTP访问控制(CORS)有关的问题), 会生成一个错误事件. 您可以通过在EventSource对象上使用onerror回调来对此采取措施:

        +

        当发生错误(例如请求超时或与HTTP访问控制(CORS)有关的问题), 会生成一个错误事件. 您可以通过在EventSource对象上使用onerror回调来对此采取措施:

        evtSource.onerror = function(err) {
           console.error("EventSource failed:", err);
        @@ -114,7 +114,7 @@ while (true) {
         
         

        事件流格式

        -

        事件流仅仅是一个简单的文本数据流,文本应该使用 UTF-8 格式的编码.每条消息后面都由一个空行作为分隔符.以冒号开头的行为注释行,会被忽略.

        +

        事件流仅仅是一个简单的文本数据流,文本应该使用 UTF-8 格式的编码.每条消息后面都由一个空行作为分隔符.以冒号开头的行为注释行,会被忽略.

        注:注释行可以用来防止连接超时,服务器可以定期发送一条消息注释行,以保持连接不断.
        diff --git a/files/zh-cn/web/api/streams_api/concepts/index.html b/files/zh-cn/web/api/streams_api/concepts/index.html index a634fb4f07..02fd6a3a82 100644 --- a/files/zh-cn/web/api/streams_api/concepts/index.html +++ b/files/zh-cn/web/api/streams_api/concepts/index.html @@ -22,7 +22,7 @@ original_slug: Web/API/Streams_API/概念
      • Pull sources 需要您在连接到它们后,显式地从它们请求数据。例如通过 Fetch 或 XHR 请求访问一个文件。
      -

      数据被按序读入到许多小块,这些小块被称作 chunkchunk 可以是单个字节,也可以是某种更大的数据类型,例如特定大小的 typed array 。来自一个流的 chunks 可以有不同的大小和类型。

      +

      数据被按序读入到许多小块,这些小块被称作 chunkchunk 可以是单个字节,也可以是某种更大的数据类型,例如特定大小的 typed array 。来自一个流的 chunks 可以有不同的大小和类型。

      diff --git a/files/zh-cn/web/api/stylesheet/disabled/index.html b/files/zh-cn/web/api/stylesheet/disabled/index.html index a18d5f068f..353f423a33 100644 --- a/files/zh-cn/web/api/stylesheet/disabled/index.html +++ b/files/zh-cn/web/api/stylesheet/disabled/index.html @@ -13,7 +13,7 @@ translation_of: Web/API/StyleSheet/disabled
      {{domxref("StyleSheet")}}接口的 disabled 属性用于决定样式表是否被禁用于文档。
      -
      样式表被禁用可能由于这个属性被手动设置为 true,也可能是因为样式表是未激活的alternative style sheet。注意 disabled == false 并不保证样式表一定生效(例如它可能被移除出文档)。
      +
      样式表被禁用可能由于这个属性被手动设置为 true,也可能是因为样式表是未激活的alternative style sheet。注意 disabled == false 并不保证样式表一定生效(例如它可能被移除出文档)。

      语法

      diff --git a/files/zh-cn/web/api/touch/target/index.html b/files/zh-cn/web/api/touch/target/index.html index be815271e8..7abb8b55fb 100644 --- a/files/zh-cn/web/api/touch/target/index.html +++ b/files/zh-cn/web/api/touch/target/index.html @@ -16,7 +16,7 @@ translation_of: Web/API/Touch/target

      概述

      -

      这个属性返回触摸点最初接触的 Element,即使这个触摸点已经移出那个元素的交互区域,甚至移出文档。需要注意的是,如果这个元素在触摸过程中被移除,这个事件仍然会指向它,因此这个事件也不会冒泡到 window 或 document 对象。因此,如果有元素在触摸过程中可能被移除,最佳实践是将触摸事件的监听器绑定到这个元素本身,防止元素被移除后,无法再从它的上一级元素上侦测到从该元素冒泡的事件。

      +

      这个属性返回触摸点最初接触的 Element,即使这个触摸点已经移出那个元素的交互区域,甚至移出文档。需要注意的是,如果这个元素在触摸过程中被移除,这个事件仍然会指向它,因此这个事件也不会冒泡到 window 或 document 对象。因此,如果有元素在触摸过程中可能被移除,最佳实践是将触摸事件的监听器绑定到这个元素本身,防止元素被移除后,无法再从它的上一级元素上侦测到从该元素冒泡的事件。

      语法

      diff --git a/files/zh-cn/web/api/url/index.html b/files/zh-cn/web/api/url/index.html index ef89407946..36ad901d75 100644 --- a/files/zh-cn/web/api/url/index.html +++ b/files/zh-cn/web/api/url/index.html @@ -131,8 +131,8 @@ console.log(parsedUrl.searchParams.get("id")); // "123"

      相关链接

      diff --git a/files/zh-cn/web/api/url/password/index.html b/files/zh-cn/web/api/url/password/index.html index 5490343afd..eb9989246a 100644 --- a/files/zh-cn/web/api/url/password/index.html +++ b/files/zh-cn/web/api/url/password/index.html @@ -8,7 +8,7 @@ original_slug: Web/API/URL/密码

       {{domxref("URL")}}接口的password属性为{{domxref("USVString")}},其中包含在域名之前指定的密码。

      -

      如果在未设置username属性的情况下进行调用,默认失败。

      +

      如果在未设置username属性的情况下进行调用,默认失败。

      {{AvailableInWorkers}}

      diff --git a/files/zh-cn/web/api/url_api/index.html b/files/zh-cn/web/api/url_api/index.html index f138baa59a..0e3e4a8d63 100644 --- a/files/zh-cn/web/api/url_api/index.html +++ b/files/zh-cn/web/api/url_api/index.html @@ -56,8 +56,8 @@ try { diff --git a/files/zh-cn/web/api/validitystate/index.html b/files/zh-cn/web/api/validitystate/index.html index 4fc6e0d3ef..64c560e215 100644 --- a/files/zh-cn/web/api/validitystate/index.html +++ b/files/zh-cn/web/api/validitystate/index.html @@ -83,6 +83,6 @@ translation_of: Web/API/ValidityState

      参见

      diff --git a/files/zh-cn/web/api/visualviewport/index.html b/files/zh-cn/web/api/visualviewport/index.html index e07f4aa91d..da9f74123e 100644 --- a/files/zh-cn/web/api/visualviewport/index.html +++ b/files/zh-cn/web/api/visualviewport/index.html @@ -15,7 +15,7 @@ translation_of: Web/API/VisualViewport ---

      {{SeeCompatTable}}{{APIRef("Visual Viewport")}}

      -

       Visual Viewport API 提供了当前页面的视觉视口接口,即 VisualViewport 。对于每个页面容器来说(如 iframe),都存在有一个独立的 window 对象。每个页面容器的 window 对象都有一个独立的 VisualViewport 属性。

      +

       Visual Viewport API 提供了当前页面的视觉视口接口,即 VisualViewport 。对于每个页面容器来说(如 iframe),都存在有一个独立的 window 对象。每个页面容器的 window 对象都有一个独立的 VisualViewport 属性。

      你可以使用 {{domxref("Window.visualViewport")}} 获得对应 window 的视觉视口 API。

      @@ -46,13 +46,13 @@ translation_of: Web/API/VisualViewport

      Events

      -

      通过使用 addEventListener() 或者将监听回调函数赋值给对应的 oneventname 属性,可以为对应的视口事件添加监听。

      +

      通过使用 addEventListener() 或者将监听回调函数赋值给对应的 oneventname 属性,可以为对应的视口事件添加监听。

      -
      resize
      +
      resize
      当视觉视口被改变时触发。
      也可以为 {{domxref("VisualViewport.onresize")}} 属性赋值来添加监听。
      -
      scroll
      +
      scroll
      当视觉视口滑动时触发。
      也可以为 {{domxref("VisualViewport.onscroll")}} 属性赋值来添加监听。
      diff --git a/files/zh-cn/web/api/webgl_api/index.html b/files/zh-cn/web/api/webgl_api/index.html index ed1f1dede2..a9ec0c7ec2 100644 --- a/files/zh-cn/web/api/webgl_api/index.html +++ b/files/zh-cn/web/api/webgl_api/index.html @@ -21,7 +21,7 @@ translation_of: Web/API/WebGL_API

      {{anch("WebGL 2")}} API引入了对大部分的OpenGL ES 3.0功能集的支持; 它是通过{{domxref("WebGL2RenderingContext")}}界面提供的

      -

       {{HTMLElement("canvas")}} 元素也被 Canvas API 用于在网页上进行2D图形处理。

      +

       {{HTMLElement("canvas")}} 元素也被 Canvas API 用于在网页上进行2D图形处理。

      参考

      @@ -149,7 +149,7 @@ translation_of: Web/API/WebGL_API
      一个基础的 WebGL 的 2D 动画示例
      此示例演示了单色形状的简单动画。检查的主题是适应宽高比差异,从多个着色器集合构建着色器程序的功能,以及 WebGL 绘图的基础知识。
      -
      WebGL示例
      +
      WebGL示例
      一系列带有简短说明的实时示例展示了WebGL的概念和功能。根据主题和难易程度对示例进行了排序,涵盖了WebGL渲染上下文,着色器编程,纹理,几何图形,用户交互等。
      diff --git a/files/zh-cn/web/api/webglrenderingcontext/createrenderbuffer/index.html b/files/zh-cn/web/api/webglrenderingcontext/createrenderbuffer/index.html index 11599ea586..86370b0652 100644 --- a/files/zh-cn/web/api/webglrenderingcontext/createrenderbuffer/index.html +++ b/files/zh-cn/web/api/webglrenderingcontext/createrenderbuffer/index.html @@ -5,7 +5,7 @@ translation_of: Web/API/WebGLRenderingContext/createRenderbuffer ---
      {{APIRef("WebGL")}}
      -

      WebGL APIWebGLRenderingContext.createRenderbuffer() 方法 创建并初始化一个 {{domxref("WebGLRenderbuffer")}} 对象。

      +

      WebGL APIWebGLRenderingContext.createRenderbuffer() 方法 创建并初始化一个 {{domxref("WebGLRenderbuffer")}} 对象。

      语法

      diff --git a/files/zh-cn/web/api/webrtc_api/taking_still_photos/index.html b/files/zh-cn/web/api/webrtc_api/taking_still_photos/index.html index c8fc957a8b..470f3dcd1d 100644 --- a/files/zh-cn/web/api/webrtc_api/taking_still_photos/index.html +++ b/files/zh-cn/web/api/webrtc_api/taking_still_photos/index.html @@ -114,13 +114,13 @@ translation_of: Web/API/WebRTC_API/Taking_still_photos

      成功回调接收一个 stream 对象作为输入。它是新视频的 {{HTMLElement("video")}} 元素的源。

      -

      一旦流被链接到 {{HTMLElement("video")}} 元素,我们通过调用 HTMLMediaElement.play() 开始播放。

      +

      一旦流被链接到 {{HTMLElement("video")}} 元素,我们通过调用 HTMLMediaElement.play() 开始播放。

      如果打开流失败,则调用失败回调函数。 在没有连接兼容的相机,或者用户拒绝访问时,则会发生这种情况。

      监听视频开始播放

      -

      在 {{HTMLElement("video")}} 上调用 HTMLMediaElement.play() 之后,在视频流开始流动之前,有一段(希望简短)的时间段过去了。 为了避免在此之前一直阻塞,我们为 {{HTMLElement("video")}} 加上一个 {{event("canplay")}} 事件的监听器,当视频播放实际开始时会触发该事件。 那时,视频对象中的所有属性都已基于流的格式进行配置。

      +

      在 {{HTMLElement("video")}} 上调用 HTMLMediaElement.play() 之后,在视频流开始流动之前,有一段(希望简短)的时间段过去了。 为了避免在此之前一直阻塞,我们为 {{HTMLElement("video")}} 加上一个 {{event("canplay")}} 事件的监听器,当视频播放实际开始时会触发该事件。 那时,视频对象中的所有属性都已基于流的格式进行配置。

          video.addEventListener('canplay', function(ev){
             if (!streaming) {
      diff --git a/files/zh-cn/web/api/window/beforeunload_event/index.html b/files/zh-cn/web/api/window/beforeunload_event/index.html
      index f582257cb1..08deab442d 100644
      --- a/files/zh-cn/web/api/window/beforeunload_event/index.html
      +++ b/files/zh-cn/web/api/window/beforeunload_event/index.html
      @@ -50,7 +50,7 @@ original_slug: Web/Events/beforeunload
       
       

      为避免意外弹出窗口,除非页面已与之交互,否则浏览器可能不会显示在beforeunload事件中创建的提示,甚至根本不会显示它们。

      -

      将事件处理程序/监听器加到window或 documentbeforeunload事件后,将阻止浏览器使用内存中的页面导航缓存,例如Firefox的Back-Forward缓存WebKit的Page Cache

      +

      将事件处理程序/监听器加到window或 documentbeforeunload事件后,将阻止浏览器使用内存中的页面导航缓存,例如Firefox的Back-Forward缓存WebKit的Page Cache

      HTML规范指出在此事件中调用{{domxref("window.alert()")}},{{domxref("window.confirm()")}}以及{{domxref("window.prompt()")}}方法,可能会失效。更多详细信息,请参见HTML规范

      diff --git a/files/zh-cn/web/api/window/devicepixelratio/index.html b/files/zh-cn/web/api/window/devicepixelratio/index.html index a5976667d9..aba68dcdf8 100644 --- a/files/zh-cn/web/api/window/devicepixelratio/index.html +++ b/files/zh-cn/web/api/window/devicepixelratio/index.html @@ -172,8 +172,8 @@ matchMedia(mqString).addListener(updatePixelRatio);

      参见

      diff --git a/files/zh-cn/web/api/window/getselection/index.html b/files/zh-cn/web/api/window/getselection/index.html index 825ee1787d..fcaf9bf733 100644 --- a/files/zh-cn/web/api/window/getselection/index.html +++ b/files/zh-cn/web/api/window/getselection/index.html @@ -48,7 +48,7 @@ translation_of: Web/API/Window/getSelection

      值得注意的是,目前在Firefox, Edge (非 Chromium 版本) 及 Internet Explorer 中,getSelection() 对 {{htmlelement("textarea")}} 及 {{htmlelement("input")}} 元素不起作用。 {{domxref("HTMLInputElement.setSelectionRange()")}} 或 selectionStart 及 selectionEnd 属性可用于解决此问题。

      -

      还要注意选择不同于焦点(详见 Selection 及输入焦点)。可使用{{domxref("Document.activeElement")}} 来返回当前的焦点元素.

      +

      还要注意选择不同于焦点(详见 Selection 及输入焦点)。可使用{{domxref("Document.activeElement")}} 来返回当前的焦点元素.

      浏览器兼容性

      diff --git a/files/zh-cn/web/api/window/requestidlecallback/index.html b/files/zh-cn/web/api/window/requestidlecallback/index.html index dc36051a1f..0632e3a3ce 100644 --- a/files/zh-cn/web/api/window/requestidlecallback/index.html +++ b/files/zh-cn/web/api/window/requestidlecallback/index.html @@ -42,7 +42,7 @@ translation_of: Web/API/Window/requestIdleCallback

      Example

      -

      See our complete example in the article Cooperative Scheduling of Background Tasks API.

      +

      See our complete example in the article Cooperative Scheduling of Background Tasks API.

      规范

      diff --git a/files/zh-cn/web/api/windoweventhandlers/onunload/index.html b/files/zh-cn/web/api/windoweventhandlers/onunload/index.html index 4d72f33a18..b4ef99f0cf 100644 --- a/files/zh-cn/web/api/windoweventhandlers/onunload/index.html +++ b/files/zh-cn/web/api/windoweventhandlers/onunload/index.html @@ -15,7 +15,7 @@ original_slug: Web/API/Window/onunload
      -

      onunload 特性(乃至 unload 事件本身) 并非使用 sendBeacon()的正确途径,要调用 sendBeacon() 接口,应当使用 visibilitychange 和 pagehide 事件。 参见 Beacon API is broken

      +

      onunload 特性(乃至 unload 事件本身) 并非使用 sendBeacon()的正确途径,要调用 sendBeacon() 接口,应当使用 visibilitychange 和 pagehide 事件。 参见 Beacon API is broken

      语法

      diff --git a/files/zh-cn/web/api/worker/index.html b/files/zh-cn/web/api/worker/index.html index 552a122239..24d6bbc738 100644 --- a/files/zh-cn/web/api/worker/index.html +++ b/files/zh-cn/web/api/worker/index.html @@ -10,19 +10,19 @@ translation_of: Web/API/Worker

      Worker 接口是 Web Workers API 的一部分,指的是一种可由脚本创建的后台任务,任务执行中可以向其创建者收发信息。要创建一个 Worker只须调用 Worker(URL) 构造函数,函数参数 `URL` 为指定的脚本。

      -

      Worker 也可以创建新的 Worker,当然,所有 Worker 必须与其创建者同源(注意:Blink暂时不支持嵌套 Worker)。 

      +

      Worker 也可以创建新的 Worker,当然,所有 Worker 必须与其创建者同源(注意:Blink暂时不支持嵌套 Worker)。 

      需要注意的是,不是所有函数和构造函数(或者说…类)都可以在 Worker 中使用。具体参考页面 Worker 所支持的函数和类。Worker 可以使用 XMLHttpRequest 发送请求,但是请求的  responseXML 与 channel 两个属性值始终返回 null (fetch 仍可正常使用,没有类似的限制)。 

      -

       如果你要在火狐浏览器的扩展使用 Worker 访问 js-ctypes,应使用 {{ domxref("ChromeWorker") }} 对象来替代。(译者注:这里没有看懂,希望有人能驳正,或添加说明)

      +

       如果你要在火狐浏览器的扩展使用 Worker 访问 js-ctypes,应使用 {{ domxref("ChromeWorker") }} 对象来替代。(译者注:这里没有看懂,希望有人能驳正,或添加说明)

      构造函数

      {{domxref("Worker.Worker", "Worker()")}}
      -
      创建一个专用Web worker,它只执行URL指定的脚本。使用 Blob URL 作为参数亦可。
      +
      创建一个专用Web worker,它只执行URL指定的脚本。使用 Blob URL 作为参数亦可。

      属性

      diff --git a/files/zh-cn/web/api/xmlhttprequest/getresponseheader/index.html b/files/zh-cn/web/api/xmlhttprequest/getresponseheader/index.html index e447182f2b..fe2e66b3c0 100644 --- a/files/zh-cn/web/api/xmlhttprequest/getresponseheader/index.html +++ b/files/zh-cn/web/api/xmlhttprequest/getresponseheader/index.html @@ -134,7 +134,7 @@ client.onreadystatechange = function() {//设定侦听器onreadystatechange。
      • 如何使用XMLHttpRequest
      • -
      • HTTP headers
      • +
      • HTTP headers
      • {{DOMxRef("XMLHttpRequest.getAllResponseHeaders", "getAllResponseHeaders()")}}
      • {{DOMxRef("XMLHttpRequest.response", "response")}}
      • 设置请求头: {{DOMxRef("XMLHttpRequest.setRequestHeader", "setRequestHeader()")}}
      • diff --git a/files/zh-cn/web/css/@keyframes/index.html b/files/zh-cn/web/css/@keyframes/index.html index f506ec158d..e420e7226e 100644 --- a/files/zh-cn/web/css/@keyframes/index.html +++ b/files/zh-cn/web/css/@keyframes/index.html @@ -9,7 +9,7 @@ translation_of: Web/CSS/@keyframes ---
        {{CSSRef}}
        -

        关键帧 @keyframes at-rule 规则通过在动画序列中定义关键帧(或waypoints)的样式来控制CSS动画序列中的中间步骤。转换 transition 相比,关键帧 keyframes 可以控制动画序列的中间步骤。

        +

        关键帧 @keyframes at-rule 规则通过在动画序列中定义关键帧(或waypoints)的样式来控制CSS动画序列中的中间步骤。转换 transition 相比,关键帧 keyframes 可以控制动画序列的中间步骤。

        @keyframes slidein {
           from {
        diff --git a/files/zh-cn/web/css/_colon_is/index.html b/files/zh-cn/web/css/_colon_is/index.html
        index 2f0a3d04de..5b1d68e355 100644
        --- a/files/zh-cn/web/css/_colon_is/index.html
        +++ b/files/zh-cn/web/css/_colon_is/index.html
        @@ -210,7 +210,7 @@ h1 {
         
         

        Avoiding selector list invalidation

        -

        Unlike selector lists, the :is() pseudo-class doesn't get invalidated when one of the selectors passed to it isn't supported by the browser.

        +

        Unlike selector lists, the :is() pseudo-class doesn't get invalidated when one of the selectors passed to it isn't supported by the browser.

        :is(:valid, :unsupported) {
           ...
        @@ -276,8 +276,8 @@ h1 {
         

        相关链接

          diff --git a/files/zh-cn/web/css/_colon_required/index.html b/files/zh-cn/web/css/_colon_required/index.html index c051cf0b14..1374ca2753 100644 --- a/files/zh-cn/web/css/_colon_required/index.html +++ b/files/zh-cn/web/css/_colon_required/index.html @@ -7,7 +7,7 @@ translation_of: 'Web/CSS/:required'

          摘要

          -

          :required  CSS 伪类 表示任意设置了{{ htmlattrxref("required", "input") }}属性的{{ HTMLElement("input") }},{{HTMLElement("select")}}, 或 {{HTMLElement("textarea")}}元素。 这个伪类对于高亮显示在提交表单之前必须具有有效数据的字段非常有用。

          +

          :required  CSS 伪类 表示任意设置了{{ htmlattrxref("required", "input") }}属性的{{ HTMLElement("input") }},{{HTMLElement("select")}}, 或 {{HTMLElement("textarea")}}元素。 这个伪类对于高亮显示在提交表单之前必须具有有效数据的字段非常有用。

          注意:{{ cssxref(":optional") }}伪类选中'可选的'表单字段。

          diff --git a/files/zh-cn/web/css/alternative_style_sheets/index.html b/files/zh-cn/web/css/alternative_style_sheets/index.html index 1d5d3c0cd7..6e6f639b88 100644 --- a/files/zh-cn/web/css/alternative_style_sheets/index.html +++ b/files/zh-cn/web/css/alternative_style_sheets/index.html @@ -42,7 +42,7 @@ translation_of: Web/CSS/Alternative_style_sheets

          Click here for a working example you can try out.

          -

          点击此处进入示例。

          +

          点击此处进入示例。

          细节

          diff --git a/files/zh-cn/web/css/border-bottom-left-radius/index.html b/files/zh-cn/web/css/border-bottom-left-radius/index.html index bc59f965fb..c1982c205c 100644 --- a/files/zh-cn/web/css/border-bottom-left-radius/index.html +++ b/files/zh-cn/web/css/border-bottom-left-radius/index.html @@ -15,7 +15,7 @@ translation_of: Web/CSS/border-bottom-left-radius

          一个无论是图像或颜色的背景,都会在边框上被裁剪,即使背景是圆角的; 裁剪的确切位置由 {{cssxref("background-clip")}} 属性定义.

          -
          如果该属性的值没有被一个在border-bottom-left-radius 属性后,作用于当前元素上的{{cssxref("border-radius")}}简写属性设置,那么该属性值将会被shorthand property重置为初始值。
          +
          如果该属性的值没有被一个在border-bottom-left-radius 属性后,作用于当前元素上的{{cssxref("border-radius")}}简写属性设置,那么该属性值将会被shorthand property重置为初始值。

          {{cssinfo}}

          diff --git a/files/zh-cn/web/css/box-shadow/index.html b/files/zh-cn/web/css/box-shadow/index.html index b01af9d276..0ef19a4f06 100644 --- a/files/zh-cn/web/css/box-shadow/index.html +++ b/files/zh-cn/web/css/box-shadow/index.html @@ -49,7 +49,7 @@ box-shadow: unset;

          向元素添加单个 box-shadow 效果时使用以下规则:

            -
          • 当给出两个、三个或四个 <length>值时。 +
          • 当给出两个、三个或四个 <length>值时。
            • 如果只给出两个值, 那么这两个值将会被当作 <offset-x><offset-y> 来解释。
            • diff --git a/files/zh-cn/web/css/clip-path/index.html b/files/zh-cn/web/css/clip-path/index.html index 8b371b1ad6..4ce0104d60 100644 --- a/files/zh-cn/web/css/clip-path/index.html +++ b/files/zh-cn/web/css/clip-path/index.html @@ -86,7 +86,7 @@ clip-path: unset;
    -

    Note: A computed value other than none results in the creation of a new stacking context the same way that CSS {{cssxref("opacity")}} does for values other than 1.

    +

    Note: A computed value other than none results in the creation of a new stacking context the same way that CSS {{cssxref("opacity")}} does for values other than 1.

    正式语法

    diff --git a/files/zh-cn/web/css/color/index.html b/files/zh-cn/web/css/color/index.html index 622c2294cf..48f4c47340 100644 --- a/files/zh-cn/web/css/color/index.html +++ b/files/zh-cn/web/css/color/index.html @@ -75,7 +75,7 @@ color: unset;

    It is important to ensure that the contrast ratio between the color of the text and the background the text is placed over is high enough that people experiencing low vision conditions will be able to read the content of the page.

    -

    Color contrast ratio is determined by comparing the luminosity of the text and background color values. In order to meet current Web Content Accessibility Guidelines (WCAG), a ratio of 4.5:1 is required for text content and 3:1 for larger text such as headings. Large text is defined as 18.66px and bold or larger, or 24px or larger.

    +

    Color contrast ratio is determined by comparing the luminosity of the text and background color values. In order to meet current Web Content Accessibility Guidelines (WCAG), a ratio of 4.5:1 is required for text content and 3:1 for larger text such as headings. Large text is defined as 18.66px and bold or larger, or 24px or larger.

    • WebAIM: Color Contrast Checker
    • @@ -155,5 +155,5 @@ p { color: hsla(0, 100%, 50%, 0.5); }
      • 颜色 {{cssxref("<color>")}} 数据类型
      • 其他颜色相关属性:{{cssxref("background-color")}}、{{cssxref("border-color")}}、{{cssxref("outline-color")}}、{{cssxref("text-decoration-color")}}、{{cssxref("text-emphasis-color")}}、{{cssxref("text-shadow")}}、{{cssxref("caret-color")}}、{{cssxref("column-rule-color")}}和{{cssxref("color-adjust")}}
      • -
      • 使用CSS对HTML元素应用颜色
      • +
      • 使用CSS对HTML元素应用颜色
      diff --git a/files/zh-cn/web/css/color_value/index.html b/files/zh-cn/web/css/color_value/index.html index c882e269af..e54bc2b58a 100644 --- a/files/zh-cn/web/css/color_value/index.html +++ b/files/zh-cn/web/css/color_value/index.html @@ -29,7 +29,7 @@ translation_of: Web/CSS/color_value
    -

    注意:本文章详细描述了<color>数据类型。如要了解更多关于在HTML中使用颜色的信息,请参阅使用CSS为HTML元素应用颜色

    +

    注意:本文章详细描述了<color>数据类型。如要了解更多关于在HTML中使用颜色的信息,请参阅使用CSS为HTML元素应用颜色

    语法

    @@ -1051,7 +1051,7 @@ translation_of: Web/CSS/color_value

    系统颜色

    -

    In forced colors mode (detectable with the forced-colors media query), most colors are restricted into a user- and browser-defined palette. These system colors are exposed by the following keywords, which can be used to ensure that the rest of the page integrates well with the restricted palette. These values may also be used in other contexts, but are not widely supported by browsers. 

    +

    In forced colors mode (detectable with the forced-colors media query), most colors are restricted into a user- and browser-defined palette. These system colors are exposed by the following keywords, which can be used to ensure that the rest of the page integrates well with the restricted palette. These values may also be used in other contexts, but are not widely supported by browsers. 

    The keywords in the following list are defined by the CSS Color Module Level 4 specification.

    @@ -1366,7 +1366,7 @@ translation_of: Web/CSS/color_value

    Accessibility considerations

    -

    Some people have difficulty distinguishing colors. The WCAG 2.0 recommendation strongly advises against using color as the only means of conveying a specific message, action, or result. See Color and color contrast for more information.

    +

    Some people have difficulty distinguishing colors. The WCAG 2.0 recommendation strongly advises against using color as the only means of conveying a specific message, action, or result. See Color and color contrast for more information.

    示例

    diff --git a/files/zh-cn/web/css/counter()/index.html b/files/zh-cn/web/css/counter()/index.html index d45b73b366..e8cfc3ce91 100644 --- a/files/zh-cn/web/css/counter()/index.html +++ b/files/zh-cn/web/css/counter()/index.html @@ -38,13 +38,13 @@ counter(countername, upper-roman)

    正式语法

    -
    counter( <custom-ident>, <counter-style>? )
    +
    counter( <custom-ident>, <counter-style>? )
     
     where
    -<counter-style> = <counter-style-name> | symbols()
    +<counter-style> = <counter-style-name> | symbols()
     
     where
    -<counter-style-name> = <custom-ident>
    +<counter-style-name> = <custom-ident>

    示例

    diff --git a/files/zh-cn/web/css/counters()/index.html b/files/zh-cn/web/css/counters()/index.html index 0e5c3dd7d3..c758a6a3ad 100644 --- a/files/zh-cn/web/css/counters()/index.html +++ b/files/zh-cn/web/css/counters()/index.html @@ -17,12 +17,12 @@ counters(countername, '-'); /* changing the counter display */ counters(countername, '.', upper-roman) -

    一个计数器本身没有可见的效果,而是通过counter()函数(和counters()函数)返回开发人员定义的字符串(或图像) 从而使计数器拥有很棒的作用。

    +

    一个计数器本身没有可见的效果,而是通过counter()函数(和counters()函数)返回开发人员定义的字符串(或图像) 从而使计数器拥有很棒的作用。

    -

    Note: counter() 函数可以与任何CSS属性一起使用,但是对"content"以外的属性的支持是试验性的,对type-or-unit参数的支持很少。

    +

    Note: counter() 函数可以与任何CSS属性一起使用,但是对"content"以外的属性的支持是试验性的,对type-or-unit参数的支持很少。

    -

    在使用此功能之前,请仔细检查浏览器兼容性表 。

    +

    在使用此功能之前,请仔细检查浏览器兼容性表 。

    Syntax

    @@ -30,24 +30,24 @@ counters(countername, '.', upper-roman)

    Values

    -
    <custom-ident> 自定义标识
    -
    一个标识计数器的名称,区分大小写,并且与counter-resetcounter-increment中的“名称”相同。名称不能以两个破折号开头,并且不能为noneunsetinitial, 或 inherit
    +
    <custom-ident> 自定义标识
    +
    一个标识计数器的名称,区分大小写,并且与counter-resetcounter-increment中的“名称”相同。名称不能以两个破折号开头,并且不能为noneunsetinitial, 或 inherit
    <counter-style> 计数器样式
    -
    计数器样式名称或 symbols() 函数,其中计数器样式名称是数字,字母或符号的简单预定义计数器样式,复杂的东亚或埃塞俄比亚长手预定义计数器样式,或其他预定义计数器样式。如果省略,则计数器样式默认为十进制。
    +
    计数器样式名称或 symbols() 函数,其中计数器样式名称是数字,字母或符号的简单预定义计数器样式,复杂的东亚或埃塞俄比亚长手预定义计数器样式,或其他预定义计数器样式。如果省略,则计数器样式默认为十进制。
    <string> 字符串
    任意数量的文本字符。非拉丁字符必须使用其Unicode转义序列进行编码:例如,\ 000A9表示版权符号。

    Formal syntax

    -
    counters( <custom-ident>, <string>, <counter-style>? )
    +
    counters( <custom-ident>, <string>, <counter-style>? )
     
     where
    -<counter-style> = <counter-style-name> | symbols()
    +<counter-style> = <counter-style-name> | symbols()
     
     where
    -<counter-style-name> = <custom-ident>
    +<counter-style-name> = <custom-ident>

    Examples

    diff --git a/files/zh-cn/web/css/css_columns/index.html b/files/zh-cn/web/css/css_columns/index.html index d9492d2552..a2202c8b61 100644 --- a/files/zh-cn/web/css/css_columns/index.html +++ b/files/zh-cn/web/css/css_columns/index.html @@ -22,7 +22,7 @@ translation_of: Web/CSS/CSS_Columns

    Relationship to Fragmentation

    -

    Multiple-column Layout is closely related to Paged Media, in that each column box becomes a fragment, much like a printed page becomes a fragment of an overall document. Therefore the properties now defined in the CSS Fragmentation specification are required in order to control how content breaks between columns. 

    +

    Multiple-column Layout is closely related to Paged Media, in that each column box becomes a fragment, much like a printed page becomes a fragment of an overall document. Therefore the properties now defined in the CSS Fragmentation specification are required in order to control how content breaks between columns. 

    参考

    @@ -58,13 +58,13 @@ translation_of: Web/CSS/CSS_Columns
    多列的基本概念
    多列布局的概述
    -
    设置列的样式
    +
    设置列的样式
    如何使用列的分隔线,以及设置列间距。
    -
    Spanning and Balancing
    +
    Spanning and Balancing
    How to make elements span across all columns and controlling the way columns are filled.
    -
    Handling Overflow in Multicol
    +
    Handling Overflow in Multicol
    What happens when an item overflows the column it is in and what happens when there is too much columned content to fit a container.
    -
    Content Breaks in Multicol
    +
    Content Breaks in Multicol
    Introduction to the Fragmentation specification and how to control where column content breaks.
    diff --git a/files/zh-cn/web/css/css_flexible_box_layout/aligning_items_in_a_flex_container/index.html b/files/zh-cn/web/css/css_flexible_box_layout/aligning_items_in_a_flex_container/index.html index 29720e70e6..90874a4ae7 100644 --- a/files/zh-cn/web/css/css_flexible_box_layout/aligning_items_in_a_flex_container/index.html +++ b/files/zh-cn/web/css/css_flexible_box_layout/aligning_items_in_a_flex_container/index.html @@ -201,14 +201,14 @@ translation_of: Web/CSS/CSS_Flexible_Box_Layout/Aligning_Items_in_a_Flex_Contain

    在本文的开头,我解释了Level1 flexbox 规范中当前包含的对齐相关属性也被包含在了Box Alignment Level3规范中,这意味着将来会很好地扩展这些属性和值。 我们已经看到了这种情况的发生, 比如:为 align-contentjustify-content 属性引入space-evenly值。

    -

    Box Alignment 模块还包含其他创建子项之间间隙的方法,比如在 CSS Grid Layout 中包含的 column-gap 和row-gap 特性 。 这些属性包含在Box Alignment规范中意味着在将来我们也应该能够在flex布局中使用column-gaprow-gap,在Firefox 63中,您将在flex布局中找到第一个浏览器对gap属性的实现。

    +

    Box Alignment 模块还包含其他创建子项之间间隙的方法,比如在 CSS Grid Layout 中包含的 column-gap 和row-gap 特性 。 这些属性包含在Box Alignment规范中意味着在将来我们也应该能够在flex布局中使用column-gaprow-gap,在Firefox 63中,您将在flex布局中找到第一个浏览器对gap属性的实现。

    -

    在深入研究flexbox对齐时,我的建议是同时查看Grid Layout中的对齐方式。 两种规范都使用Box Alignment规范中详细说明的对齐属性。您可以在MDN文章《Box Alignment in Grid Layout》中查看使用网格时这些属性的行为,并且我还在《 Box Alignment Cheatsheet》中比较了这些规范中对齐的工作方式。

    +

    在深入研究flexbox对齐时,我的建议是同时查看Grid Layout中的对齐方式。 两种规范都使用Box Alignment规范中详细说明的对齐属性。您可以在MDN文章《Box Alignment in Grid Layout》中查看使用网格时这些属性的行为,并且我还在《 Box Alignment Cheatsheet》中比较了这些规范中对齐的工作方式。

    更多

    diff --git a/files/zh-cn/web/css/css_selectors/index.html b/files/zh-cn/web/css/css_selectors/index.html index 33963cb0d6..eb84561833 100644 --- a/files/zh-cn/web/css/css_selectors/index.html +++ b/files/zh-cn/web/css/css_selectors/index.html @@ -24,23 +24,23 @@ translation_of: Web/CSS/CSS_Selectors

    基本选择器

    -
    通用选择器Universal selector
    +
    通用选择器Universal selector
    选择所有元素。(可选)可以将其限制为特定的名称空间或所有名称空间。
    语法:* ns|* *|*
    例子:* 将匹配文档的所有元素。
    -
    元素选择器Type selector
    +
    元素选择器Type selector
    按照给定的节点名称,选择所有匹配的元素。
    语法:elementname
    例子:input 匹配任何 {{HTMLElement( "input" )}} 元素。
    -
    类选择器Class selector
    +
    类选择器Class selector
    按照给定的 class 属性的值,选择所有匹配的元素。
    语法.classname
    例子.index 匹配任何 class 属性中含有 "index" 类的元素。
    -
    ID 选择器ID selector
    +
    ID 选择器ID selector
    按照 id 属性选择一个与之匹配的元素。需要注意的是,一个文档中,每个 ID 属性都应当是唯一的。
    语法:#idname
    例子:#toc 匹配 ID 为 "toc" 的元素。
    -
    属性选择器Attribute selector
    +
    属性选择器Attribute selector
    按照给定的属性,选择所有匹配的元素。
    语法:[attr] [attr=value] [attr~=value] [attr|=value] [attr^=value] [attr$=value] [attr*=value]
    例子:[autoplay] 选择所有具有 autoplay 属性的元素(不论这个属性的值是什么)。
    @@ -49,7 +49,7 @@ translation_of: Web/CSS/CSS_Selectors

    分组选择器(Grouping selectors)

    -
    选择器列表Selector list
    +
    选择器列表Selector list
    , 是将不同的选择器组合在一起的方法,它选择所有能被列表中的任意一个选择器选中的节点。
    语法A, B
    示例div, span 会同时匹配 {{HTMLElement("span")}} 元素和 {{HTMLElement("div")}} 元素。
    @@ -58,19 +58,19 @@ translation_of: Web/CSS/CSS_Selectors

    组合器(Combinators)

    -
    后代组合器Descendant combinator
    +
    后代组合器Descendant combinator
     (空格)组合器选择前一个元素的后代节点。
    语法:A B
    例子:div span 匹配所有位于任意 {{HTMLElement("div")}} 元素之内的 {{HTMLElement("span")}} 元素。
    -
    直接子代组合器Child combinator
    +
    直接子代组合器Child combinator
    > 组合器选择前一个元素的直接子代的节点。
    语法A > B
    例子ul > li 匹配直接嵌套在 {{HTMLElement("ul")}} 元素内的所有 {{HTMLElement("li")}} 元素。
    -
    一般兄弟组合器General sibling combinator
    +
    一般兄弟组合器General sibling combinator
    ~ 组合器选择兄弟元素,也就是说,后一个节点在前一个节点后面的任意位置,并且共享同一个父节点。
    语法A ~ B
    例子p ~ span 匹配同一父元素下,{{HTMLElement("p")}} 元素后的所有 {{HTMLElement("span")}} 元素。
    -
    紧邻兄弟组合器Adjacent sibling combinator
    +
    紧邻兄弟组合器Adjacent sibling combinator
    + 组合器选择相邻元素,即后一个元素紧跟在前一个之后,并且共享同一个父节点。
    语法:A + B
    例子:h2 + p 会匹配所有紧邻在 {{HTMLElement("h2")}} 元素后的 {{HTMLElement("p")}} 元素。
    diff --git a/files/zh-cn/web/css/display/index.html b/files/zh-cn/web/css/display/index.html index 189002afdb..8605b74a25 100644 --- a/files/zh-cn/web/css/display/index.html +++ b/files/zh-cn/web/css/display/index.html @@ -6,7 +6,7 @@ tags: translation_of: Web/CSS/display ---
    {{CSSRef}} -

    display 属性可以设置元素的内部和外部显示类型 display types。元素的外部显示类型 outer display types 将决定该元素在流式布局中的表现(块级或内联元素);元素的内部显示类型 inner display types 可以控制其子元素的布局(例如:flow layoutgridflex)。

    +

    display 属性可以设置元素的内部和外部显示类型 display types。元素的外部显示类型 outer display types 将决定该元素在流式布局中的表现(块级或内联元素);元素的内部显示类型 inner display types 可以控制其子元素的布局(例如:flow layoutgridflex)。

    CSS 规范(特指 CSS Level 1/2/3 规范)中查阅 display 属性的所有取值时需要注意:个别取值的详细信息记录在独立的规范中。 例如,display: flex 的详细信息在 CSS Flexible Box Model 规范中记录。可以在本文档末尾的表格中查看所有有关的规范。

    @@ -75,7 +75,7 @@ translation_of: Web/CSS/display } -

    有关规范变更的更多信息,查阅文章 Adapting to the new two-value syntax of display

    +

    有关规范变更的更多信息,查阅文章 Adapting to the new two-value syntax of display

    全局设置

    @@ -89,47 +89,47 @@ display: unset;

    上面 {{anch("语法")}} 部分提供了 display 取值的多个示例。下面的资料将详细介绍 display 的各个取值。

    CSS Flow Layout (display: blockdisplay: inline)

    display: flex

    display: grid

    除此之外,你可以在 MDN 上找到布局模型的详细解释:

    @@ -164,7 +164,7 @@ display: unset; @@ -220,7 +220,7 @@ display: unset; diff --git a/files/zh-cn/web/css/flex-grow/index.html b/files/zh-cn/web/css/flex-grow/index.html index e341a60900..b71ba6bd03 100644 --- a/files/zh-cn/web/css/flex-grow/index.html +++ b/files/zh-cn/web/css/flex-grow/index.html @@ -10,7 +10,7 @@ translation_of: Web/CSS/flex-grow ---
    {{CSSRef}}
    -

    CSS属性 flex-grow设置了一个flex项主尺寸的flex增长系数。它指定了flex容器中剩余空间的多少应该分配给项目(flex增长系数)。

    +

    CSS属性 flex-grow设置了一个flex项主尺寸的flex增长系数。它指定了flex容器中剩余空间的多少应该分配给项目(flex增长系数)。

    主尺寸是项的宽度或高度,这取决于{{cssxref("flex-direction")}}值。

    @@ -122,7 +122,7 @@ flex-grow: unset; diff --git a/files/zh-cn/web/css/gradient/linear-gradient()/index.html b/files/zh-cn/web/css/gradient/linear-gradient()/index.html index c8c25b68e2..df99cec0e6 100644 --- a/files/zh-cn/web/css/gradient/linear-gradient()/index.html +++ b/files/zh-cn/web/css/gradient/linear-gradient()/index.html @@ -101,7 +101,7 @@ linear-gradient(red 0%, orange 10% 30%, yellow 50% 70%, green 90% 100%);
    <

    正式语法

    linear-gradient(
    -  [ <angle> | to <side-or-corner> ,]? <color-stop-list> )
    +  [ <angle> | to <side-or-corner> ,]? <color-stop-list> )
       \---------------------------------/ \----------------------------/
         Definition of the gradient line        List of color stops
     
    diff --git a/files/zh-cn/web/css/gradient/radial-gradient()/index.html b/files/zh-cn/web/css/gradient/radial-gradient()/index.html
    index 78750ad563..2b9cfeff39 100644
    --- a/files/zh-cn/web/css/gradient/radial-gradient()/index.html
    +++ b/files/zh-cn/web/css/gradient/radial-gradient()/index.html
    @@ -91,10 +91,10 @@ radial-gradient(circle at center, red 0, blue, green 100%)

    Formal syntax

    radial-gradient(
    -  [ [ circle || <length> ]                         [ at <position> ]? , |
    -    [ ellipse || [ <length> | <percentage> ]{2} ]  [ at <position> ]? , |
    -    [ [ circle | ellipse ] || <extent-keyword> ] [at <position> ]? , |
    -    at <position> ,
    +  [ [ circle || <length> ]                         [ at <position> ]? , |
    +    [ ellipse || [ <length> | <percentage> ]{2} ]  [ at <position> ]? , |
    +    [ [ circle | ellipse ] || <extent-keyword> ] [at <position> ]? , |
    +    at <position> ,
       ]?
       <color-stop-list> [ , <color-stop-list> ]+
     )
    diff --git a/files/zh-cn/web/css/layout_cookbook/contribute_a_recipe/index.html b/files/zh-cn/web/css/layout_cookbook/contribute_a_recipe/index.html
    index 37ceeddd92..58a0e5bd4c 100644
    --- a/files/zh-cn/web/css/layout_cookbook/contribute_a_recipe/index.html
    +++ b/files/zh-cn/web/css/layout_cookbook/contribute_a_recipe/index.html
    @@ -81,7 +81,7 @@ translation_of: Web/CSS/Layout_cookbook/Contribute_a_recipe
     
     

    If you need general guidance on using the MDN wiki, see the help pages available here.

    -

    If you need to ask any questions, or want someone to take a look at your page then the MDN Discourse forum is a good place to do this, or chat with us on Matrix.

    +

    If you need to ask any questions, or want someone to take a look at your page then the MDN Discourse forum is a good place to do this, or chat with us on Matrix.

    See also

    diff --git a/files/zh-cn/web/css/length/index.html b/files/zh-cn/web/css/length/index.html index 35276c797e..813bee1cce 100644 --- a/files/zh-cn/web/css/length/index.html +++ b/files/zh-cn/web/css/length/index.html @@ -118,7 +118,7 @@ translation_of: Web/CSS/length

    插值

    -

    当包含动画效果时,动画中<length>的值是由计算出的值使用插值法得出的浮点实数。插值的速度由动画的定时函数决定。

    +

    当包含动画效果时,动画中<length>的值是由计算出的值使用插值法得出的浮点实数。插值的速度由动画的定时函数决定。

    示例

    diff --git a/files/zh-cn/web/css/list-style-type/index.html b/files/zh-cn/web/css/list-style-type/index.html index 6350c67987..fd7edd0e5d 100644 --- a/files/zh-cn/web/css/list-style-type/index.html +++ b/files/zh-cn/web/css/list-style-type/index.html @@ -10,13 +10,13 @@ translation_of: Web/CSS/list-style-type ---
    {{CSSRef}}
    -

     CSS 属性 list-style-type 可以设置列表元素的 marker(比如圆点、符号、或者自定义计数器样式)。

    +

     CSS 属性 list-style-type 可以设置列表元素的 marker(比如圆点、符号、或者自定义计数器样式)。

    {{EmbedInteractiveExample("pages/css/list-style-type.html")}}
    -

    The color of the marker will be the same as the computed color of the element it applies to.

    +

    The color of the marker will be the same as the computed color of the element it applies to.

    只有几个元素 ({{HTMLElement("li")}} 和 {{HTMLElement("summary")}}) 的默认值为 display: list-item。 但是, list-style-type 属性可以应用在任何 {{cssxref("display")}} 的值为 list-item 的元素上。此外,由于这个属性是可继承的,它可以设置在父元素上 (通常是 {{HTMLElement("ol")}} 或 {{HTMLElement("ul")}}) 以便应用于所有子元素({{HTMLElement("li")}})。

    @@ -49,10 +49,10 @@ list-style-type: unset;

    list-style-type 的属性值可以是以下任意一项:

    取值

    @@ -499,7 +499,7 @@ ol.shortcut {

    Accessibility concerns

    -

    The VoiceOver screen reader has an issue where unordered lists with a list-style-typevalue of none applied to them will not be announced as a list. To address this, add a zero-width space as pseudo content before each list item to ensure the list is announced properly. This ensures the design is unaffected by the bug fix and that list items are not improperly described.

    +

    The VoiceOver screen reader has an issue where unordered lists with a list-style-typevalue of none applied to them will not be announced as a list. To address this, add a zero-width space as pseudo content before each list item to ensure the list is announced properly. This ensures the design is unaffected by the bug fix and that list items are not improperly described.

    ul {
       list-style: none;
    @@ -511,7 +511,7 @@ ul li::before {
     
     
     
    diff --git a/files/zh-cn/web/css/media_queries/using_media_queries/index.html b/files/zh-cn/web/css/media_queries/using_media_queries/index.html
    index 0063d28a5a..375eedc7fb 100644
    --- a/files/zh-cn/web/css/media_queries/using_media_queries/index.html
    +++ b/files/zh-cn/web/css/media_queries/using_media_queries/index.html
    @@ -369,7 +369,7 @@ original_slug: Web/Guide/CSS/Media_queries
     

    媒体查询4级规范对语法进行了一些改进,以使用具有“范围”类型(例如宽度或高度,减少冗余)的功能进行媒体查询。 级别4添加了用于编写此类的查询范围上下文。 例如,使用最大宽度max- 功能,我们可以编写以下代码:

    -

    Note: 媒体查询4级规范在现代浏览器中具有合理的支持,但某些媒体功能并未得到很好的支持。 有关更多详细信息,请参见 @media browser compatibility table

    +

    Note: 媒体查询4级规范在现代浏览器中具有合理的支持,但某些媒体功能并未得到很好的支持。 有关更多详细信息,请参见 @media browser compatibility table

    @media (max-width: 30em) { ... }
    diff --git a/files/zh-cn/web/css/place-items/index.html b/files/zh-cn/web/css/place-items/index.html index 6c9d14db3e..eb53e9eceb 100644 --- a/files/zh-cn/web/css/place-items/index.html +++ b/files/zh-cn/web/css/place-items/index.html @@ -7,7 +7,7 @@ translation_of: Web/CSS/place-items -

    CSS 中的 place-items 是一个简写属性 ,它允许你在相关的布局(如 Grid 或 Flexbox)中可以同时沿着块级和内联方向对齐元素 (例如:{{CSSxRef("align-items")}} 和 {{CSSxRef("justify-items")}} 属性) 。如果未提供第二个值,则第一个值作为第二个值的默认值。

    +

    CSS 中的 place-items 是一个简写属性 ,它允许你在相关的布局(如 Grid 或 Flexbox)中可以同时沿着块级和内联方向对齐元素 (例如:{{CSSxRef("align-items")}} 和 {{CSSxRef("justify-items")}} 属性) 。如果未提供第二个值,则第一个值作为第二个值的默认值。

    {{EmbedInteractiveExample("pages/css/place-items.html")}}
    diff --git a/files/zh-cn/web/css/shorthand_properties/index.html b/files/zh-cn/web/css/shorthand_properties/index.html index 63af2be2be..f29a699b71 100644 --- a/files/zh-cn/web/css/shorthand_properties/index.html +++ b/files/zh-cn/web/css/shorthand_properties/index.html @@ -149,7 +149,7 @@ margin-left: 5px;

    {{page("/zh-CN/docs/Learn/CSS/Building_blocks/Cascade_and_inheritance", "Controlling_inheritance")}}

    -

    查看 Cascade and inheritance or Introducing the CSS Cascade 了解更多关于继承的信息。

    +

    查看 Cascade and inheritance or Introducing the CSS Cascade 了解更多关于继承的信息。

    另请参阅

    diff --git a/files/zh-cn/web/css/specificity/index.html b/files/zh-cn/web/css/specificity/index.html index 61d41391f9..bf5ad8bb9a 100644 --- a/files/zh-cn/web/css/specificity/index.html +++ b/files/zh-cn/web/css/specificity/index.html @@ -38,7 +38,7 @@ translation_of: Web/CSS/Specificity

    通配选择符(universal selector)({{CSSxRef("Universal_selectors", "*")}})关系选择符(combinators)({{CSSxRef("Adjacent_sibling_combinator", "+")}}, {{CSSxRef("Child_combinator", ">")}}, {{CSSxRef("General_sibling_combinator", "~")}}, ' ', {{CSSxRef("Column_combinator", "||")}})和 否定伪类(negation pseudo-class)({{CSSxRef(":not", ":not()")}})对优先级没有影响。(但是,在 :not() 内部声明的选择器会影响优先级)。

    -

    您可以访问 "Specificity" in "Cascade and inheritance"  或者 https://specifishity.com 来了解更多关于优先级的详细信息。

    +

    您可以访问 "Specificity" in "Cascade and inheritance"  或者 https://specifishity.com 来了解更多关于优先级的详细信息。

    给元素添加的内联样式 (例如,style="font-weight:bold") 总会覆盖外部样式表的任何样式 ,因此可看作是具有最高的优先级。

    diff --git a/files/zh-cn/web/css/transform-function/matrix()/index.html b/files/zh-cn/web/css/transform-function/matrix()/index.html index 61a7db5124..85c5d7bc8e 100644 --- a/files/zh-cn/web/css/transform-function/matrix()/index.html +++ b/files/zh-cn/web/css/transform-function/matrix()/index.html @@ -81,4 +81,4 @@ translation_of: Web/CSS/transform-function/matrix()

    结果

    -

    请看英文版案例 https://wiki.developer.mozilla.org/en-US/docs/Web/CSS/transform-function/matrix#Result

    +

    请看英文版案例 /zh-CN/docs/Web/CSS/transform-function/matrix#Result

    diff --git a/files/zh-cn/web/css/transform-function/translatey()/index.html b/files/zh-cn/web/css/transform-function/translatey()/index.html index 3c210ee62e..cbce9c8b14 100644 --- a/files/zh-cn/web/css/transform-function/translatey()/index.html +++ b/files/zh-cn/web/css/transform-function/translatey()/index.html @@ -105,7 +105,7 @@ transform: translateY(50%);

    浏览器兼容性

    -

    请查看 <transform-function>

    +

    请查看 <transform-function>

    了解更多

    diff --git a/files/zh-cn/web/css/using_css_custom_properties/index.html b/files/zh-cn/web/css/using_css_custom_properties/index.html index daeae20d1a..60ff3a2bad 100644 --- a/files/zh-cn/web/css/using_css_custom_properties/index.html +++ b/files/zh-cn/web/css/using_css_custom_properties/index.html @@ -177,7 +177,7 @@ translation_of: Web/CSS/Using_CSS_custom_properties

    自定义属性备用值

    -

    用 {{cssxref("var()")}} 函数可以定义多个备用值(fallback value),当给定值未定义时将会用备用值替换。这对于 Custom ElementsShadow DOM 都很有用。

    +

    用 {{cssxref("var()")}} 函数可以定义多个备用值(fallback value),当给定值未定义时将会用备用值替换。这对于 Custom ElementsShadow DOM 都很有用。

    备用值并不是用于实现浏览器兼容性的。如果浏览器不支持CSS自定义属性,备用值也没什么用。它仅对支持CSS自定义属性的浏览器提供了一个备份机制,该机制仅当给定值未定义或是无效值的时候生效。

    diff --git a/files/zh-cn/web/css/width/index.html b/files/zh-cn/web/css/width/index.html index 9bcfdb63af..aee395afbf 100644 --- a/files/zh-cn/web/css/width/index.html +++ b/files/zh-cn/web/css/width/index.html @@ -42,8 +42,8 @@ width: unset;

    width 属性也指定为:

    @@ -148,7 +148,7 @@ width: unset;

    当页面放大以增加文本大小时,请确保 width 设置的元素不会被截断并且不会遮挡其他内容。

    diff --git a/files/zh-cn/web/css/writing-mode/index.html b/files/zh-cn/web/css/writing-mode/index.html index ea47547767..4eaba44816 100644 --- a/files/zh-cn/web/css/writing-mode/index.html +++ b/files/zh-cn/web/css/writing-mode/index.html @@ -193,12 +193,12 @@ th {

    请参阅

    diff --git a/files/zh-cn/web/css/z-index/index.html b/files/zh-cn/web/css/z-index/index.html index ea8919ea70..7ef2adc6c2 100644 --- a/files/zh-cn/web/css/z-index/index.html +++ b/files/zh-cn/web/css/z-index/index.html @@ -38,7 +38,7 @@ z-index: inherit; z-index: initial; z-index: unset; -

    z-index 属性可以被设定为关键词 auto<integer>

    +

    z-index 属性可以被设定为关键词 auto<integer>

    取值

    diff --git a/files/zh-cn/web/events/creating_and_triggering_events/index.html b/files/zh-cn/web/events/creating_and_triggering_events/index.html index 686d6471af..ea96143dea 100644 --- a/files/zh-cn/web/events/creating_and_triggering_events/index.html +++ b/files/zh-cn/web/events/creating_and_triggering_events/index.html @@ -24,7 +24,7 @@ elem.addEventListener('build', function (e) { ... }, false); // Dispatch the event. elem.dispatchEvent(event); -

    上述代码使用了 EventTarget.dispatchEvent() 方法。

    +

    上述代码使用了 EventTarget.dispatchEvent() 方法。

    绝大多数现代浏览器中都会支持这个构造函数(Internet Explorer 例外)。 要了解更为复杂的方法,可参考下面的 过时的方式  一节。

    diff --git a/files/zh-cn/web/guide/ajax/index.html b/files/zh-cn/web/guide/ajax/index.html index 42cc4d78df..db3c85786f 100644 --- a/files/zh-cn/web/guide/ajax/index.html +++ b/files/zh-cn/web/guide/ajax/index.html @@ -7,7 +7,7 @@ translation_of: Web/Guide/AJAX  Ajax简介
    -

    Asynchronous JavaScript + XML(异步JavaScript和XML), 其本身不是一种新技术,而是一个在 2005年被Jesse James Garrett提出的新术语,用来描述一种使用现有技术集合的‘新’方法,包括: HTML 或 XHTML,  CSS, JavaScript, DOM, XML, XSLT, 以及最重要的 {{domxref("XMLHttpRequest")}}。当使用结合了这些技术的AJAX模型以后, 网页应用能够快速地将增量更新呈现在用户界面上,而不需要重载(刷新)整个页面。这使得程序能够更快地回应用户的操作。

    +

    Asynchronous JavaScript + XML(异步JavaScript和XML), 其本身不是一种新技术,而是一个在 2005年被Jesse James Garrett提出的新术语,用来描述一种使用现有技术集合的‘新’方法,包括: HTML 或 XHTML,  CSS, JavaScript, DOM, XML, XSLT, 以及最重要的 {{domxref("XMLHttpRequest")}}。当使用结合了这些技术的AJAX模型以后, 网页应用能够快速地将增量更新呈现在用户界面上,而不需要重载(刷新)整个页面。这使得程序能够更快地回应用户的操作。

    尽管X在Ajax中代表XML, 但由于{{glossary("JSON")}}的许多优势,比如更加轻量以及作为Javascript的一部分,目前JSON的使用比XML更加普遍。JSON和XML都被用于在Ajax模型中打包信息。

    @@ -29,7 +29,7 @@ translation_of: Web/Guide/AJAX
  • Web workers中使用Ajax
  • -
    Fetch API
    +
    Fetch API
    Fetch API 提供一个获取资源的接口。对于用过 {{domxref("XMLHTTPRequest")}} 的人来说会觉得很熟悉,但这个API提供了更加强大且灵活的特性。
    Server-sent 事件
    在过去,一个网页必须发送请求到服务器来获取新的数据,也就是说,网页必须主动向服务器请求数据。有了server-sent events之后,服务器可以向网页推送消息,使得服务器可以随时向网页传送数据。这些发送过来的消息可以看作是带有数据的事件。参见: Using server-sent events.
    diff --git a/files/zh-cn/web/houdini/index.html b/files/zh-cn/web/houdini/index.html index 130725938c..68259ebd34 100644 --- a/files/zh-cn/web/houdini/index.html +++ b/files/zh-cn/web/houdini/index.html @@ -12,18 +12,18 @@ translation_of: Web/Houdini

    Houdini 的优点

    -

    当样式改变时Houdini相比JavaScript.style 的方式能够能够更快的解析。  浏览器在应用脚本中发现的任何样式更新之前,会对CSSOM进行解析--包括布局、绘制和合成过程。此外,对于JavaScript样式更新,布局、绘制和复合过程也会重复进行。Houdini代码不会等待第一个渲染周期完成。相反,它被包含在第一个周期中--创建可渲染的、可理解的样式。Houdini为在JavaScript中使用CSS值提供了一个基于对象的API。

    +

    当样式改变时Houdini相比JavaScript.style 的方式能够能够更快的解析。  浏览器在应用脚本中发现的任何样式更新之前,会对CSSOM进行解析--包括布局、绘制和合成过程。此外,对于JavaScript样式更新,布局、绘制和复合过程也会重复进行。Houdini代码不会等待第一个渲染周期完成。相反,它被包含在第一个周期中--创建可渲染的、可理解的样式。Houdini为在JavaScript中使用CSS值提供了一个基于对象的API。

    -

    Houdini 的 CSS Typed OM 是一个包含类型和方法的 CSS 对象、并且暴露出了作为 JavaScript 对象的值。比起先前基于字符串的,对  HTMLElement.style 进行操作的方案,对 JavaScript 对象进行操作更符合直觉。每个元素和样式表规则都拥有一个样式对应表,该对应表可以通过  StylePropertyMap 来获得。

    +

    Houdini 的 CSS Typed OM 是一个包含类型和方法的 CSS 对象、并且暴露出了作为 JavaScript 对象的值。比起先前基于字符串的,对  HTMLElement.style 进行操作的方案,对 JavaScript 对象进行操作更符合直觉。每个元素和样式表规则都拥有一个样式对应表,该对应表可以通过  StylePropertyMap 来获得。

    -

    一个 CSS Houdini 的特性就是  Worklet。在它的帮助下,你可以通过引入一行 JavaScript 代码来引入配置化的组件,从而创建模块式的 CSS。不依赖任何前置处理器、后置处理器或者 JavaScript 框架。

    +

    一个 CSS Houdini 的特性就是  Worklet。在它的帮助下,你可以通过引入一行 JavaScript 代码来引入配置化的组件,从而创建模块式的 CSS。不依赖任何前置处理器、后置处理器或者 JavaScript 框架。

    <script>
       CSS.paintWorklet.addModule('csscomponent.js');
     </script>
     
    -

    以上添加进的模块包含一个  registerPaint()函数,这个模块是完全通过可配置的 worklets 来注册的。

    +

    以上添加进的模块包含一个  registerPaint()函数,这个模块是完全通过可配置的 worklets 来注册的。

    这个 CSS  paint()  函数的参数包括 worklet 的名字,以及其他可选的参数。worklet 同时能够访问元素的自定义属性:它们不需要作为函数参数传递。

    diff --git a/files/zh-cn/web/html/attributes/index.html b/files/zh-cn/web/html/attributes/index.html index 846e47bddd..eb514c19f5 100644 --- a/files/zh-cn/web/html/attributes/index.html +++ b/files/zh-cn/web/html/attributes/index.html @@ -25,64 +25,64 @@ translation_of: Web/HTML/Attributes - accept + accept {{ HTMLElement("form") }}, {{ HTMLElement("input") }} 服务器接受内容或文件类型的列表。 - accept-charset + accept-charset {{ HTMLElement("form") }} 支持的字符集列表。 - accesskey + accesskey 全局属性 定义键盘快捷键来激活或者聚焦元素 - action + action {{ HTMLElement("form") }} 表单信息提交的url地址,指向进行处理的程序。 - align + align {{ HTMLElement("applet") }}, {{ HTMLElement("caption") }}, {{ HTMLElement("col") }}, {{ HTMLElement("colgroup") }},  {{ HTMLElement("hr") }}, {{ HTMLElement("iframe") }}, {{ HTMLElement("img") }}, {{ HTMLElement("table") }}, {{ HTMLElement("tbody") }},  {{ HTMLElement("td") }},  {{ HTMLElement("tfoot") }} , {{ HTMLElement("th") }}, {{ HTMLElement("thead") }}, {{ HTMLElement("tr") }} 设置元素的水平对齐。 - allow + allow {{ HTMLElement("iframe") }} Specifies a feature-policy for the iframe. - alt + alt

    {{ HTMLElement("applet") }}, {{ HTMLElement("area") }}, {{ HTMLElement("img") }}, {{ HTMLElement("input") }}

    在图片无法呈现时的替代文本。 - async + async {{ HTMLElement("script") }} 表示该脚本应该异步执行。 - autocapitalize - 全局属性 + autocapitalize + 全局属性 Sets whether input is automatically capitalized when entered by user - autocomplete + autocomplete {{ HTMLElement("form") }}, {{ HTMLElement("input") }}, {{ HTMLElement("select") }}, {{ HTMLElement("textarea") }} 表示该表单中是否可以由浏览器自动完成填值。 - autofocus + autofocus {{ HTMLElement("button") }}, {{ HTMLElement("input") }}, {{ HTMLElement("keygen") }}, {{ HTMLElement("select") }}, {{ HTMLElement("textarea") }} 在网页加载后该元素应该自动聚焦。 - autoplay + autoplay {{ HTMLElement("audio") }}, {{ HTMLElement("video") }}  audio或video应该自动播放 @@ -116,12 +116,12 @@ translation_of: Web/HTML/Attributes - buffered + buffered {{ HTMLElement("audio") }}, {{ HTMLElement("video") }} 包含已缓存媒体的时间范围。 - capture + capture {{ HTMLElement("input") }} From the HTML Media Capture
    The definition of 'media capture' in that specification.
    spec, specifies a new file can be captured. @@ -132,32 +132,32 @@ translation_of: Web/HTML/Attributes 与公钥一起提交的挑战字符。 - charset + charset {{ HTMLElement("meta") }}, {{ HTMLElement("script") }} 申明该页面或脚本的字符编码。 - checked + checked {{ HTMLElement("command") }}, {{ HTMLElement("input") }} 指出该元素在页面加载后是否处于选中状态。 - cite + cite {{ HTMLElement("blockquote") }}, {{ HTMLElement("del") }}, {{ HTMLElement("ins") }}, {{ HTMLElement("q") }} 包含一个URI,用来指明引用或修改的源地址。 - class + class 全局属性 经常和CSS一起配合使用来修饰元素。 - code + code {{ HTMLElement("applet") }} 标明被加载和执行的applet类文件的URL。 - codebase + codebase {{ HTMLElement("applet") }} 指出存放applet类文件基本URL地址(绝对或相对),这些文件由code属性标明。 @@ -173,53 +173,53 @@ translation_of: Web/HTML/Attributes - cols + cols {{ HTMLElement("textarea") }} 定义一个textarea中包含多少列。 - colspan + colspan {{ HTMLElement("td") }}, {{ HTMLElement("th") }} 该属性一般用在td标签中,用于指定一个单元格占用多少列,例如:<td colspan='2'>表示占用一个单元格占2列. - content + content {{ HTMLElement("meta") }} A value associated with http-equiv or name depending on the context. - contenteditable + contenteditable 全局属性 指出该元素的内容是否可以被编辑。 - contextmenu + contextmenu 全局属性 定义将用作元素上下文菜单的{{HTMLElement("Menu")}}元素的ID。 - controls + controls {{ HTMLElement("audio") }}, {{ HTMLElement("video") }} 指出浏览器是否对用户显示播放控制台(前进或回退) - coords + coords {{ HTMLElement("area") }} A set of values specifying the coordinates of the hot-spot region. - crossorigin + crossorigin {{ HTMLElement("audio") }}, {{ HTMLElement("img") }}, {{ HTMLElement("link") }}, {{ HTMLElement("script") }}, {{ HTMLElement("video") }} How the element handles cross-origin requests - csp {{experimental_inline}} + csp {{experimental_inline}} {{ HTMLElement("iframe") }} Specifies the Content Security Policy that an embedded document must agree to enforce upon itself. -

    data

    +

    data

    {{ HTMLElement("object") }}

    @@ -230,7 +230,7 @@ translation_of: Web/HTML/Attributes -

    data-*

    +

    data-*

    全局属性

    @@ -240,77 +240,77 @@ translation_of: Web/HTML/Attributes - datetime + datetime {{ HTMLElement("del") }}, {{ HTMLElement("ins") }}, {{ HTMLElement("time") }} Indicates the date and time associated with the element. - decoding + decoding {{ HTMLElement("img") }} Indicates the preferred method to decode the image. - default + default {{ HTMLElement("track") }} Indicates that the track should be enabled unless the user's preferences indicate something different. - defer + defer {{ HTMLElement("script") }} Indicates that the script should be executed after the page has been parsed. - dir + dir 全局属性 Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) - dirname + dirname {{ HTMLElement("input") }}, {{ HTMLElement("textarea") }} - disabled + disabled {{ HTMLElement("button") }}, {{ HTMLElement("command") }}, {{ HTMLElement("fieldset") }}, {{ HTMLElement("input") }}, {{ HTMLElement("keygen") }}, {{ HTMLElement("optgroup") }}, {{ HTMLElement("option") }}, {{ HTMLElement("select") }}, {{ HTMLElement("textarea") }} Indicates whether the user can interact with the element. - download + download {{ HTMLElement("a") }}, {{ HTMLElement("area") }} Indicates that the hyperlink is to be used for downloading a resource. - draggable + draggable 全局属性 Defines whether the element can be dragged. - dropzone + dropzone 全局属性 Indicates that the element accept the dropping of content on it. - enctype + enctype {{ HTMLElement("form") }} Defines the content type of the form date when the method is POST. - enterkeyhint {{experimental_inline}} - {{ HTMLElement("input") }}, {{ HTMLElement("textarea") }}, contenteditable + enterkeyhint {{experimental_inline}} + {{ HTMLElement("input") }}, {{ HTMLElement("textarea") }}, contenteditable The enterkeyhint specifies what action label (or icon) to present for the enter key on virtual keyboards. The attribute can be used with form controls (such as the value of textarea elements), or in elements in an editing host (e.g., using contenteditable attribute). - for + for {{ HTMLElement("label") }}, {{ HTMLElement("output") }} 描述与当前元素绑定的元素。 - form + form {{ HTMLElement("button") }}, {{ HTMLElement("fieldset") }}, {{ HTMLElement("input") }}, {{ HTMLElement("keygen") }}, {{ HTMLElement("label") }}, {{ HTMLElement("meter") }}, {{ HTMLElement("object") }}, {{ HTMLElement("output") }}, {{ HTMLElement("progress") }}, {{ HTMLElement("select") }}, {{ HTMLElement("textarea") }} Indicates the form that is the owner of the element. - formaction + formaction <input><button> Indicates the action of the element, overriding the action defined in the <form>. @@ -689,5 +689,5 @@ translation_of: Web/HTML/Attributes

    参见

    diff --git a/files/zh-cn/web/html/element/audio/index.html b/files/zh-cn/web/html/element/audio/index.html index c7782d664a..a2b7a3a241 100644 --- a/files/zh-cn/web/html/element/audio/index.html +++ b/files/zh-cn/web/html/element/audio/index.html @@ -27,20 +27,20 @@ translation_of: Web/HTML/Element/audio
    {{htmlattrdef("autoplay")}}
    布尔值属性;声明该属性,音频会尽快自动播放,不会等待整个音频文件下载完成。
    -

    注意:自动播放音频(或有声视频)可能会破坏用户体验,所以应该尽可能避免。如果你一定要提供自动播放功能,你应该加入开关(让用户主动打开自动播放)。然而,如果需要创建一些媒体元素,其播放源由用户在稍后设置,自动播放就会很有用。想了解如果正确使用自动播放,可参见我们的自动播放指南

    +

    注意:自动播放音频(或有声视频)可能会破坏用户体验,所以应该尽可能避免。如果你一定要提供自动播放功能,你应该加入开关(让用户主动打开自动播放)。然而,如果需要创建一些媒体元素,其播放源由用户在稍后设置,自动播放就会很有用。想了解如果正确使用自动播放,可参见我们的自动播放指南

    {{htmlattrdef("controls")}}
    如果声明了该属性,浏览器将提供一个包含声音,播放进度,播放暂停的控制面板,让用户可以控制音频的播放。
    {{htmlattrdef("crossorigin")}}
    -
    枚举属性  展示音频资源是否可以通过CORS加载。支持CORS的资源  可以被 {{HTMLElement("canvas")}} 元素复用而不污染. 可选值如下: +
    枚举属性  展示音频资源是否可以通过CORS加载。支持CORS的资源  可以被 {{HTMLElement("canvas")}} 元素复用而不污染. 可选值如下:
    anonymous
    在发送跨域请求时不携带验证信息。换句话说,浏览器在发送Origin: HTTP 请求首部时将不携带 cookie、 X.509 安全令牌、也不会执行任何 HTTP 基本认证。如果服务器没有给予源站信任(也就是说没有设置 Access-Control-Allow-Origin: 响应首部),那么图片就被认为是污染的,它就会被限制使用。
    use-credentials
    在发送跨域请求时不携带验证信息。换句话说,在发送Origin: HTTP 请求首部时将携带 cookie、安全令牌、并且执行 HTTP 基本认证。如果服务器没有给予源站信任(通过设置Access-Control-Allow-Credentials: 响应首部)那么图片就被认为是污染的,它就会被限制使用。
    - 在未指定时,资源将不通过 CORS 请求来获取(也就是不发送 Origin: 请求首部),以保护 {{HTMLElement('canvas')}}  元素中未污染的内容。如果验证失败,它会表现的好像 anonymous 选项是选中的。查看 CORS settings attributes 来获取更多信息。
    + 在未指定时,资源将不通过 CORS 请求来获取(也就是不发送 Origin: 请求首部),以保护 {{HTMLElement('canvas')}}  元素中未污染的内容。如果验证失败,它会表现的好像 anonymous 选项是选中的。查看 CORS settings attributes 来获取更多信息。
    {{htmlattrdef("currentTime")}}

    读取 currentTime 属性将返回一个双精度浮点值,用以标明以秒为单位的当前音频的播放位置。如果音频的元数据暂时无法访问——这意味着你无法的知道媒体的开始或持续时间。这时,currentTime 相对应的,能够被用于改变重播的时间。否则,设置 currentTime 将设置当前的播放位置,并且会自动搜寻到媒体的那个位置,如果媒体目前已经被加载的话。

    @@ -54,7 +54,7 @@ translation_of: Web/HTML/Element/audio
    {{htmlattrdef("duration")}} {{ReadOnlyInline}}
    -
    这是一个双精度浮点数,指明了音频在时间轴中的持续时间(总长度),以秒为单位。如果元素上没有媒体,或者媒体是不可用的,那么会返回 NaN。如果媒体找不到确切的结尾(比如不确定长度的直播流,网络电台,或者是通过 WebRTC 连接的流),那么这个值将返回 +Infinity
    +
    这是一个双精度浮点数,指明了音频在时间轴中的持续时间(总长度),以秒为单位。如果元素上没有媒体,或者媒体是不可用的,那么会返回 NaN。如果媒体找不到确切的结尾(比如不确定长度的直播流,网络电台,或者是通过 WebRTC 连接的流),那么这个值将返回 +Infinity
    {{htmlattrdef("loop")}}
    布尔属性;如果声明该属性,将循环播放音频。
    {{htmlattrdef("muted")}}
    @@ -120,7 +120,7 @@ translation_of: Web/HTML/Element/audio {{domxref("HTMLMediaElement.emptied_event", 'emptied')}} -

    媒体置空。举个例子,当一个媒体已经加载(或部分加载)的情况下话调用 load() 方法,这个事件就将被触发。

    +

    媒体置空。举个例子,当一个媒体已经加载(或部分加载)的情况下话调用 load() 方法,这个事件就将被触发。

    @@ -200,7 +200,7 @@ translation_of: Web/HTML/Element/audio

    使用说明

    -

    浏览器对 文件类型 和 音频编码 的支持各有不同,你可以使用内嵌的 {{htmlelement("source")}} 元素提供不同的播放源。浏览器会使用第一个它支持的播放源:

    +

    浏览器对 文件类型 和 音频编码 的支持各有不同,你可以使用内嵌的 {{htmlelement("source")}} 元素提供不同的播放源。浏览器会使用第一个它支持的播放源:

    <audio controls>
       <source src="myAudio.mp3" type="audio/mpeg">
    @@ -209,18 +209,18 @@ translation_of: Web/HTML/Element/audio
          a <a href="myAudio.mp4">link to the audio</a> instead.</p>
     </audio>
    -

    我们提供了全面细致的 音频文件类型指南 和 这些类型可以使用的音频编码。此外,还有 视频编码支持指南

    +

    我们提供了全面细致的 音频文件类型指南 和 这些类型可以使用的音频编码。此外,还有 视频编码支持指南

    其他使用说明:

    • 如果你没有声明 controls 属性,音频播放器不会包含浏览器的默认控件。但你可以使用 JavaScript 和 {{domxref("HTMLMediaElement")}} API 创建自己的自定义控件。
    • -
    • 为了更精确地控制你的音频内容,HTMLMediaElement 会触发多种不同的 事件。这也提供了一个查看音频获取过程的方式,你可以查看错误或检测什么时候可以开始播放或操作。
    • -
    • 你还可以使用 Web Audio API 以从 JavaScript 代码直接生成和操纵音频流,而非流式播放已存在的音频文件。
    • +
    • 为了更精确地控制你的音频内容,HTMLMediaElement 会触发多种不同的 事件。这也提供了一个查看音频获取过程的方式,你可以查看错误或检测什么时候可以开始播放或操作。
    • +
    • 你还可以使用 Web Audio API 以从 JavaScript 代码直接生成和操纵音频流,而非流式播放已存在的音频文件。
    • <audio> 元素不能像 <video> 元素一样附加副标题(subtitle)或说明标题(caption)。更多有用的信息和解决方法参见 Ian Devlin 的 WebVTT and Audio
    -

    视频和音频内容 新手教程是一篇关于使用 HTML <audio> 的好文章。

    +

    视频和音频内容 新手教程是一篇关于使用 HTML <audio> 的好文章。

    使用 CSS 设置样式

    @@ -232,7 +232,7 @@ translation_of: Web/HTML/Element/audio

    如果在跨浏览器中得到一致的外观和体验,你需要创建自定义控件;自定义控件可以根据你的需求任意设置样式,还可以使用 JavaScript 和 {{domxref("HTMLMediaElement")}} API 来设置更多功能。

    -

    视频播放器样式基础 提供了一些有用的样式技术,这篇文章围绕 <video> 而写,但大部分都可以用于 <audio>

    +

    视频播放器样式基础 提供了一些有用的样式技术,这篇文章围绕 <video> 而写,但大部分都可以用于 <audio>

    检测音轨添加和移除

    @@ -282,7 +282,7 @@ elem.audioTrackList.onremovetrack = function(event) { </audio> -

    如果想获得更多信息,包括何时自动播放生效,如何获取自动播放权限,并且通过何种方式,在何时应用自动播放才是合适的,请看我们的 autoplay guide

    +

    如果想获得更多信息,包括何时自动播放生效,如何获取自动播放权限,并且通过何种方式,在何时应用自动播放才是合适的,请看我们的 autoplay guide

    <audio> 元素与 <source> 元素

    @@ -306,7 +306,7 @@ elem.audioTrackList.onremovetrack = function(event) {

    可访问性考虑

    -

    语音形式的音频必须同时提供标题,以及确切描述其内容的文本。标题(Captions)是由 WebVTT 标准定义的,允许听力障碍的人群能够通过播放(文字)记录来理解音频内容。转录文字允许那些需要额外时间的人们,以适合他们的速度和格式回顾记录的内容。

    +

    语音形式的音频必须同时提供标题,以及确切描述其内容的文本。标题(Captions)是由 WebVTT 标准定义的,允许听力障碍的人群能够通过播放(文字)记录来理解音频内容。转录文字允许那些需要额外时间的人们,以适合他们的速度和格式回顾记录的内容。

    如果使用自动标题服务,人工检查生成内容是很重要的,这确保了标题能够准确的描述源音频。

    @@ -342,10 +342,10 @@ Welcome to the Time Keeper's podcast! In this episode we're discussing which Swi @@ -355,8 +355,8 @@ Welcome to the Time Keeper's podcast! In this episode we're discussing which Swi - - + + @@ -421,17 +421,17 @@ Welcome to the Time Keeper's podcast! In this episode we're discussing which Swi

    参见

    diff --git a/files/zh-cn/web/html/element/fieldset/index.html b/files/zh-cn/web/html/element/fieldset/index.html index 3da899a141..7eda6a559a 100644 --- a/files/zh-cn/web/html/element/fieldset/index.html +++ b/files/zh-cn/web/html/element/fieldset/index.html @@ -39,7 +39,7 @@ translation_of: Web/HTML/Element/fieldset

    <fieldset> 有几种特别的样式方案。

    -

    它的 {{cssxref("display")}} 值默认为 block,因此建立了一个块级格式化上下文。如果将 <fieldset> 的 display 值设置为行内级别,则会表现为 inline-block,否则会表现为 block。默认情况下 <fieldset> 会有 2px groove 的边界围绕着内容,还有一个默认的小的内边距,还有 {{cssxref("min-inline-size", "min-inline-size: min-content")}} 。

    +

    它的 {{cssxref("display")}} 值默认为 block,因此建立了一个块级格式化上下文。如果将 <fieldset> 的 display 值设置为行内级别,则会表现为 inline-block,否则会表现为 block。默认情况下 <fieldset> 会有 2px groove 的边界围绕着内容,还有一个默认的小的内边距,还有 {{cssxref("min-inline-size", "min-inline-size: min-content")}} 。

    如果其中有 {{htmlelement("legend")}} 元素,会放在块级框起始处的边界上。<legend> 的宽度会根据内容尽量收缩(shrink-wrap),同时也建立了一个格式化上下文。display 值会块级化(例如  display: inline 表现为 block)。

    @@ -48,7 +48,7 @@ translation_of: Web/HTML/Element/fieldset

    你可以以任意方式自行设置 <fieldset> 和 <legend> 的样式以配合你的页面设计。

    -

    注意:截至这篇文章发出为止,Microsoft Edge 和 Google Chrome 不能在 {{HTMLElement("fieldset")}} 中使用 flexbox 和 grid 布局。这个 GitHub issue 跟踪了这个bug。

    +

    注意:截至这篇文章发出为止,Microsoft Edge 和 Google Chrome 不能在 {{HTMLElement("fieldset")}} 中使用 flexbox 和 grid 布局。这个 GitHub issue 跟踪了这个bug。

    示例

    @@ -92,8 +92,8 @@ translation_of: Web/HTML/Element/fieldset
    Content categoriesFlow content, phrasing content, embedded content. If it has a {{htmlattrxref("controls", "audio")}} attribute: interactive content and palpable content.Content categoriesFlow content, phrasing content, embedded content. If it has a {{htmlattrxref("controls", "audio")}} attribute: interactive content and palpable content.
    合法内容
    - - + + @@ -105,7 +105,7 @@ translation_of: Web/HTML/Element/fieldset - + diff --git a/files/zh-cn/web/html/element/form/index.html b/files/zh-cn/web/html/element/form/index.html index 14308b9497..c25d741f14 100644 --- a/files/zh-cn/web/html/element/form/index.html +++ b/files/zh-cn/web/html/element/form/index.html @@ -41,11 +41,11 @@ translation_of: Web/HTML/Element/form - + - + @@ -78,7 +78,7 @@ translation_of: Web/HTML/Element/form
    {{htmlattrdef("autocomplete")}}
    用于指示 input 元素是否能够拥有一个默认值,此默认值是由浏览器自动补全的。此设定可以被属于此表单的子元素的 autocomplete 属性覆盖。 可能的值有:
      -
    • off:浏览器可能不会自动补全条目(在疑似登录表单中,浏览器倾向于忽略该值,而提供密码自动填充功能,参见 自动填充属性和登录
    • +
    • off:浏览器可能不会自动补全条目(在疑似登录表单中,浏览器倾向于忽略该值,而提供密码自动填充功能,参见 自动填充属性和登录
    • on:浏览器可自动补全条目
    @@ -87,7 +87,7 @@ translation_of: Web/HTML/Element/form
    {{htmlattrdef("name")}}
    表单的名称。HTML 4中不推荐(应使用 id)。在 HTML 5 中,该值必须是所有表单中独一无二的,而且不能是空字符串。
    {{htmlattrdef("rel")}}
    -
    根据 value 创建一个超链接或Creates a hyperlink or annotation depending on the value, see the {{htmlattrdef("rel")}} attribute for details.
    +
    根据 value 创建一个超链接或Creates a hyperlink or annotation depending on the value, see the {{htmlattrdef("rel")}} attribute for details.

    关于提交表单的属性

    @@ -96,7 +96,7 @@ translation_of: Web/HTML/Element/form
    {{htmlattrdef("action")}}
    -
    处理表单提交的 URL。这个值可被 {{HTMLElement("button")}}、<input type="submit"> 或 <input type="image"> 元素上的 {{htmlattrxref("formaction", "button")}} 属性覆盖。
    +
    处理表单提交的 URL。这个值可被 {{HTMLElement("button")}}、<input type="submit"> 或 <input type="image"> 元素上的 {{htmlattrxref("formaction", "button")}} 属性覆盖。
    @@ -108,13 +108,13 @@ translation_of: Web/HTML/Element/form
  • text/plain:出现于 HTML5,用于调试。
  • -

    这个值可被 {{HTMLElement("button")}}、<input type="submit"> 或 <input type="image"> 元素上的 {{htmlattrxref("formaction", "button")}} 属性覆盖。

    +

    这个值可被 {{HTMLElement("button")}}、<input type="submit"> 或 <input type="image"> 元素上的 {{htmlattrxref("formaction", "button")}} 属性覆盖。

    {{htmlattrdef("method")}}
    浏览器使用这种 HTTP 方式来提交 表单. 可能的值有:
    • post:指的是 HTTP POST 方法;表单数据会包含在表单体内然后发送给服务器.
    • -
    • get:指的是 HTTP GET 方法;表单数据会附加在 action 属性的 URL 中,并以 '?' 作为分隔符,没有副作用 时使用这个方法。
    • +
    • get:指的是 HTTP GET 方法;表单数据会附加在 action 属性的 URL 中,并以 '?' 作为分隔符,没有副作用 时使用这个方法。
    • dialog:如果表单在 {{HTMLElement("dialog")}} 元素中,提交时关闭对话框。
    diff --git a/files/zh-cn/web/html/element/hgroup/index.html b/files/zh-cn/web/html/element/hgroup/index.html index 99a782ad8c..fe8045aad3 100644 --- a/files/zh-cn/web/html/element/hgroup/index.html +++ b/files/zh-cn/web/html/element/hgroup/index.html @@ -66,9 +66,9 @@ translation_of: Web/HTML/Element/hgroup

    The <hgroup> element allows the primary heading for a document section to be grouped with any secondary headings—such as subheadings or alternative titles—to form a multi-level heading.

    -

    In other words, the <hgroup> element prevents any of its secondary <h1>–<h6> children from creating separate sections of their own in the outline—as those <h1>–<h6> elements otherwise normally would if they were not children of any <hgroup>.

    +

    In other words, the <hgroup> element prevents any of its secondary <h1>–<h6> children from creating separate sections of their own in the outline—as those <h1>–<h6> elements otherwise normally would if they were not children of any <hgroup>.

    -

    So in the abstract outline produced by the HTML outline algorithm defined in the HTML specification, the <hgroup> as a whole forms a single logical heading, with the entire set of <h1>–<h6> children of the <hgroup> going into the outline as one multi-level unit, to comprise that single logical heading in the abstract outline.

    +

    So in the abstract outline produced by the HTML outline algorithm defined in the HTML specification, the <hgroup> as a whole forms a single logical heading, with the entire set of <h1>–<h6> children of the <hgroup> going into the outline as one multi-level unit, to comprise that single logical heading in the abstract outline.

    To produce any (non-abstract) rendered view of such an outline, some choice must be made in the design of the rendering tool about how to render <hgroup> headings in such a way as to convey their multi-level nature. There are a variety of ways an <hgroup> might be shown in a rendered outline; for example:

    diff --git a/files/zh-cn/web/html/element/input/hidden/index.html b/files/zh-cn/web/html/element/input/hidden/index.html index 7f87b5441d..a1ed459082 100644 --- a/files/zh-cn/web/html/element/input/hidden/index.html +++ b/files/zh-cn/web/html/element/input/hidden/index.html @@ -107,7 +107,7 @@ translation_of: Web/HTML/Element/input/hidden

    隐藏输入表单还用于存储和提交安全令牌或机密信息,以提高网站的安全性。基本思路是,如果用户填写敏感表格,例如在其银行网站上将某笔款项转入另一个帐户的表格,他们将被提供的密钥和证明他们就是他们所说的真实身份,并且他们使用正确的表单来提交转移请求。

    -

    这将阻止恶意用户创建伪造的表单,伪装成银行,然后通过电子邮件将表单发送给毫无戒备心的用户,以诱骗他们将钱转入错误的位置。 这种攻击称为跨站点请求伪造(CSRF);几乎任何信誉良好的服务器端框架都使用隐藏机密来防止此类攻击。

    +

    这将阻止恶意用户创建伪造的表单,伪装成银行,然后通过电子邮件将表单发送给毫无戒备心的用户,以诱骗他们将钱转入错误的位置。 这种攻击称为跨站点请求伪造(CSRF);几乎任何信誉良好的服务器端框架都使用隐藏机密来防止此类攻击。

    如前所述,将密钥放置在隐藏的输入中并不能使其固有安全性。 密钥的组成和编码已经可以做到这一点。隐藏输入的值是保持它与数据关联性,并在将表单发送到服务器时自动将其包含在内。 您需要使用精心设计的密钥来真正保护您的网站。

    diff --git a/files/zh-cn/web/html/element/input/index.html b/files/zh-cn/web/html/element/input/index.html index f0f61c5d8f..3efd79c60f 100644 --- a/files/zh-cn/web/html/element/input/index.html +++ b/files/zh-cn/web/html/element/input/index.html @@ -300,7 +300,7 @@ translation_of: Web/HTML/Element/input
    内容目录Flow contentsectioning rootlistedform-associated element, palpable content.内容目录Flow contentsectioning rootlistedform-associated element, palpable content.
    允许的内容
    允许的父元素Any element that accepts flow content.Any element that accepts flow content.
    默认 ARIA role
    Implicit ARIA roleform if the form has an accessible name, otherwise no corresponding roleform if the form has an accessible name, otherwise no corresponding role
    Permitted ARIA rolessearch, {{ARIARole("group")}}, {{ARIARole("presentation")}}search, {{ARIARole("group")}}, {{ARIARole("presentation")}}
    DOM 接口
    -

    {{htmlelement('input')}}元素的属性包括全局HTML属性和以下属性:

    +

    {{htmlelement('input')}}元素的属性包括全局HTML属性和以下属性:

    @@ -434,12 +434,12 @@ translation_of: Web/HTML/Element/input - + - + @@ -556,7 +556,7 @@ translation_of: Web/HTML/Element/input
    {{ htmlattrdef("checked") }}
    如果该元素的type属性的值为radio或者checkbox,则该布尔属性的存在与否表明了该控件是否是默认选择状态。 -

    If present on a checkbox type, it indicates that the checkbox is checked by default (when the page loads). It does not indicate whether this checkbox is currently checked: if the checkbox’s state is changed, this content attribute does not reflect the change. (Only the HTMLInputElement’s checked IDL attribute is updated.)

    +

    If present on a checkbox type, it indicates that the checkbox is checked by default (when the page loads). It does not indicate whether this checkbox is currently checked: if the checkbox’s state is changed, this content attribute does not reflect the change. (Only the HTMLInputElement’s checked IDL attribute is updated.)

    Note: Unlike other input controls, a checkboxes and radio buttons value are only included in the submitted data if they are currently checked. If they are, the name and the value(s) of the checked controls are submitted.

    @@ -672,7 +672,7 @@ translation_of: Web/HTML/Element/input

    Per the specifications, the list attribute is not supported by the hiddenpasswordcheckboxradiofile, or any of the button types.

    -

    Depending on the browser, the user may see a custom color palette suggested, tic marks along a range, or even a input that opens like a select but allows for non-listed values. Check out the browser compatibility table for the other input types.

    +

    Depending on the browser, the user may see a custom color palette suggested, tic marks along a range, or even a input that opens like a select but allows for non-listed values. Check out the browser compatibility table for the other input types.

    See the {{htmlelement('datalist')}} element.

    @@ -687,7 +687,7 @@ translation_of: Web/HTML/Element/input

    Valid for textsearchurltelemail, and password, it defines the minimum number of characters (as UTF-16 code units) the user can enter into the entry field. This must be an non-negative integer value smaller than or equal to the value specified by maxlength. If no minlength is specified, or an invalid value is specified, the input has no minimum length.

    -

    The input will fail constraint validation if the length of the text entered into the field is fewer than minlength UTF-16 code units long, preventing form submission. See {{anch("Client-side validation")}} for more information.

    +

    The input will fail constraint validation if the length of the text entered into the field is fewer than minlength UTF-16 code units long, preventing form submission. See {{anch("Client-side validation")}} for more information.

    {{ htmlattrdef("multiple") }}{{ HTMLVersionInline(5) }}
    This Boolean attribute indicates whether the user can enter more than one value.这个属性指示用户能否输入多个值。这个属性仅在type属性为email或file的时候生效 ; 否则被忽视.
    @@ -820,7 +820,7 @@ translation_of: Web/HTML/Element/input - + diff --git a/files/zh-cn/web/html/element/input/reset/index.html b/files/zh-cn/web/html/element/input/reset/index.html index 5af6fbd48b..e24d084a31 100644 --- a/files/zh-cn/web/html/element/input/reset/index.html +++ b/files/zh-cn/web/html/element/input/reset/index.html @@ -19,7 +19,7 @@ translation_of: Web/HTML/Element/input/reset
    -

    您通常应该尽量避免在表单中包含重置按钮。 它们很少有实用性,事实上更有可能使用户误点而感到沮丧(通常是在尝试单击“提交”按钮时)。

    +

    您通常应该尽量避免在表单中包含重置按钮。 它们很少有实用性,事实上更有可能使用户误点而感到沮丧(通常是在尝试单击“提交”按钮时)。

    当表单控件为空时,控件中显示的内容
    readonlyreadonly 绝大部分 布尔值。存在时表示控件的值不可编辑
    requiredrequired 绝大部分 布尔值。表示此值为必填项或者提交表单前必须先检查该值
    :placeholder-shownElement that is currently displaying placeholder text, including input elements with the placeholder attribute present that has, as of yet, no value.Element that is currently displaying placeholder text, including input elements with the placeholder attribute present that has, as of yet, no value.
    :default
    @@ -67,7 +67,7 @@ translation_of: Web/HTML/Element/input/reset

    使用重置按钮

    -

    <input type =“ reset”> 按钮用于重置表单。 如果您要创建自定义按钮,则使用JavaScript自定义行为,您需要使用 <input type="button">,或者最好使用 {{htmlelement("button")}} 元素。

    +

    <input type =“ reset”> 按钮用于重置表单。 如果您要创建自定义按钮,则使用JavaScript自定义行为,您需要使用 <input type="button">,或者最好使用 {{htmlelement("button")}} 元素。

    一个简单的重置按钮

    diff --git a/files/zh-cn/web/html/element/input/search/index.html b/files/zh-cn/web/html/element/input/search/index.html index 800971c9c1..64afa2ba8d 100644 --- a/files/zh-cn/web/html/element/input/search/index.html +++ b/files/zh-cn/web/html/element/input/search/index.html @@ -469,5 +469,5 @@ input:valid ~ span:after {
  • HTML 表单
  • {{HTMLElement("input")}} 及其所基于的接口 {{domxref("HTMLInputElement")}} 
  • <input type="text">
  • -
  • CSS 属性的兼容性
  • +
  • CSS 属性的兼容性
  • diff --git a/files/zh-cn/web/html/element/link/index.html b/files/zh-cn/web/html/element/link/index.html index 786ecb0e16..e2b2038e43 100644 --- a/files/zh-cn/web/html/element/link/index.html +++ b/files/zh-cn/web/html/element/link/index.html @@ -198,7 +198,7 @@ translation_of: Web/HTML/Element/link
    {{HTMLAttrDef("title")}}
    -
    属性在<link>元素上有特殊的语义。当用于<link rel="stylesheet">时,它定义了一个首选样式表或备用样式表。不正确地使用它可能会导致样式表被忽略
    +
    属性在<link>元素上有特殊的语义。当用于<link rel="stylesheet">时,它定义了一个首选样式表或备用样式表。不正确地使用它可能会导致样式表被忽略
    {{htmlattrdef("type")}}
    这个属性被用于定义链接的内容的类型。这个属性的值应该是像text/html,text/css等MIME类型。这个属性常用的用法是定义链接的样式表,最常用的值是表明了CSS的text/css。
    @@ -221,7 +221,7 @@ translation_of: Web/HTML/Element/link
    {{htmlattrdef("rev")}}{{obsolete_inline}}
    -
    此属性的值显示了 {{HTMLAttrxRef("href", "link")}} 属性所定义的当前文档与链接文档的关系。 因此,该属性定义了与rel属性的值相比的反向关系。 该属性的Link type value类似于{{HTMLAttrxRef("rel", "link")}}的可能值。
    +
    此属性的值显示了 {{HTMLAttrxRef("href", "link")}} 属性所定义的当前文档与链接文档的关系。 因此,该属性定义了与rel属性的值相比的反向关系。 该属性的Link type value类似于{{HTMLAttrxRef("rel", "link")}}的可能值。

    Note: WHATWG HTML生活标准(MDN将其视为规范的规范)认为该属性已过时。 但是,值得注意的是,rev在W3C规范中并未过时。 就是说,鉴于不确定性,依靠rev是不明智的。

    diff --git a/files/zh-cn/web/html/element/meta/index.html b/files/zh-cn/web/html/element/meta/index.html index 4594e71125..ed6d77bafb 100644 --- a/files/zh-cn/web/html/element/meta/index.html +++ b/files/zh-cn/web/html/element/meta/index.html @@ -53,7 +53,7 @@ translation_of: Web/HTML/Element/meta
  • content-security-policy
    它允许页面作者定义当前页的内容策略。 内容策略主要指定允许的服务器源和脚本端点,这有助于防止跨站点脚本攻击。
  • content-type
    - 如果使用这个属性,其值必须是"text/html; charset=utf-8"。注意:该属性只能用于 MIME typetext/html 的文档,不能用于MIME类型为XML的文档。
  • + 如果使用这个属性,其值必须是"text/html; charset=utf-8"。注意:该属性只能用于 MIME typetext/html 的文档,不能用于MIME类型为XML的文档。
  • default-style

    设置默认 CSS 样式表组的名称。

  • @@ -75,8 +75,8 @@ translation_of: Web/HTML/Element/meta

    设置了 refresh 值的页面可能有时间间隔太短的风险。使用诸如屏幕朗读这样的辅助技术来浏览网页的人可能会由于自动跳转而来不及读完或理解网页的内容。这样不经提示而突然进行的页面刷新也可能会让有视力障碍的人群感到迷惑。

    {{htmlattrdef("name")}}
    namecontent 属性可以一起使用,以名-值对的方式给文档提供元数据,其中 name 作为元数据的名称,content 作为元数据的值。
    -
    标准元数据名称中查看 HTML 规范等规范中定义的标准元数据名称。
    +
    标准元数据名称中查看 HTML 规范等规范中定义的标准元数据名称。

    示例

    diff --git a/files/zh-cn/web/html/element/progress/index.html b/files/zh-cn/web/html/element/progress/index.html index aba8a6466f..6d14b6890e 100644 --- a/files/zh-cn/web/html/element/progress/index.html +++ b/files/zh-cn/web/html/element/progress/index.html @@ -15,16 +15,16 @@ translation_of: Web/HTML/Element/progress

    使用上下文

    -
    使用策略                流文本(Flow content), 短文本(phrasing content)
    -Content categories     可标记内容,可触摸内容
    +
    使用策略                流文本(Flow content), 短文本(phrasing content)
    +Content categories     可标记内容,可触摸内容
     
    -有效内容                Phrasing content, 其中在它的后代中不能包含
    +有效内容                Phrasing content, 其中在它的后代中不能包含
     Permitted content      <progress>元素.
     
     标签省略                不可以,{{no_tag_omission}}
     Tag omission
     
    -有效的父元素             任何可以包裹短文本(phrasing content)的元素.
    +有效的父元素             任何可以包裹短文本(phrasing content)的元素.
     
     隐式元素                {{ARIARole("progressbar")}}
     ARIA role
    diff --git a/files/zh-cn/web/html/element/script/index.html b/files/zh-cn/web/html/element/script/index.html
    index 047dcfc899..11a899ea1d 100644
    --- a/files/zh-cn/web/html/element/script/index.html
    +++ b/files/zh-cn/web/html/element/script/index.html
    @@ -10,7 +10,7 @@ tags:
       - 网络
     translation_of: Web/HTML/Element/script
     ---
    -
    HTML <script> 元素用于嵌入或引用可执行脚本。这通常用作嵌入或者指向 JavaScript 代码。<script> 元素也能在其他语言中使用,比如 WebGL 的 GLSL 着色器语言。
    +
    HTML <script> 元素用于嵌入或引用可执行脚本。这通常用作嵌入或者指向 JavaScript 代码。<script> 元素也能在其他语言中使用,比如 WebGL 的 GLSL 着色器语言。
    @@ -53,7 +53,7 @@ translation_of: Web/HTML/Element/script
    对于普通脚本,如果存在 async 属性,那么普通脚本会被并行请求,并尽快解析和执行。
    -
    对于模块脚本,如果存在 async 属性,那么脚本及其所有依赖都会在延缓队列中执行,因此它们会被并行请求,并尽快解析和执行。
    +
    对于模块脚本,如果存在 async 属性,那么脚本及其所有依赖都会在延缓队列中执行,因此它们会被并行请求,并尽快解析和执行。
    该属性能够消除解析阻塞的 Javascript。解析阻塞的 Javascript 会导致浏览器必须加载并且执行脚本,之后才能继续解析。defer 在这一点上也有类似的作用。
    这是个布尔属性:布尔属性的存在意味着 true 值,布尔属性的缺失意味着 false 值。
    关于浏览器支持请参见{{anch("浏览器兼容性")}}。另可参见文章asm.js的异步脚本
    diff --git a/files/zh-cn/web/html/element/select/index.html b/files/zh-cn/web/html/element/select/index.html index fa0d3e3cfa..57f094a833 100644 --- a/files/zh-cn/web/html/element/select/index.html +++ b/files/zh-cn/web/html/element/select/index.html @@ -24,7 +24,7 @@ translation_of: Web/HTML/Element/select

    你还可以将 <option> 元素放在 {{htmlelement("optgroup")}} 元素中以为下拉菜单创建不同的选项分组。

    -

    在 原生表单部件 中查看更多示例。

    +

    在 原生表单部件 中查看更多示例。

    属性

    @@ -87,9 +87,9 @@ translation_of: Web/HTML/Element/select

    应用 CSS 样式

    -

    众所周知,<select>元素很难用 CSS 进行高效的设计。你可以像其他元素一样改变某些方面——例如,调整 盒模型显示的字体 等,你还可以使用 {{cssxref("appearance")}} 属性来去除默认的系统外观。

    +

    众所周知,<select>元素很难用 CSS 进行高效的设计。你可以像其他元素一样改变某些方面——例如,调整 盒模型显示的字体 等,你还可以使用 {{cssxref("appearance")}} 属性来去除默认的系统外观。

    -

    但是,这些属性的表现在不同浏览器之间并不一致,而且有些事情难以很好地处理,例如在一列中顺序排列不同类型的表单元素。 <select>元素的内部结构复杂,难以控制。 如果你想完全控制,你应该考虑使用一个在修改表单部件样式方面拥有强大能力的库,或者尝试使用非语义元素和 JavaScript 来制作下拉菜单,再使用 WAI-ARIA 来提供语义。

    +

    但是,这些属性的表现在不同浏览器之间并不一致,而且有些事情难以很好地处理,例如在一列中顺序排列不同类型的表单元素。 <select>元素的内部结构复杂,难以控制。 如果你想完全控制,你应该考虑使用一个在修改表单部件样式方面拥有强大能力的库,或者尝试使用非语义元素和 JavaScript 来制作下拉菜单,再使用 WAI-ARIA 来提供语义。

    有关样式<select>的更多有用信息,请参阅:

    @@ -150,8 +150,8 @@ translation_of: Web/HTML/Element/select
    - - + + @@ -163,7 +163,7 @@ translation_of: Web/HTML/Element/select - + diff --git a/files/zh-cn/web/html/element/style/index.html b/files/zh-cn/web/html/element/style/index.html index 7542db4262..dfc2f7c41a 100644 --- a/files/zh-cn/web/html/element/style/index.html +++ b/files/zh-cn/web/html/element/style/index.html @@ -35,7 +35,7 @@ translation_of: Web/HTML/Element/style

    {{htmlattrdef("nonce")}}

    -
    一种加密的随机数(一次使用的数字),用于在style-src Content-Security-Policy中将内联样式列入白名单。 服务器每次发送策略时都必须生成一个唯一的随机数值。 提供一个无法猜测的随机数非常重要,因为绕开资源策略是微不足道的。
    +
    一种加密的随机数(一次使用的数字),用于在style-src Content-Security-Policy中将内联样式列入白名单。 服务器每次发送策略时都必须生成一个唯一的随机数值。 提供一个无法猜测的随机数非常重要,因为绕开资源策略是微不足道的。
    {{htmlattrdef("title")}}
    指定可选的样式表。
    @@ -170,5 +170,5 @@ translation_of: Web/HTML/Element/style diff --git a/files/zh-cn/web/html/element/textarea/index.html b/files/zh-cn/web/html/element/textarea/index.html index 0416c01444..a9bd73acc7 100644 --- a/files/zh-cn/web/html/element/textarea/index.html +++ b/files/zh-cn/web/html/element/textarea/index.html @@ -97,7 +97,7 @@ translation_of: Web/HTML/Element/textarea

    <textarea>可被替换的元素——其有自己的固有尺寸,像。默认情况下,其 {{cssxref("display")}} 值为 block。与其他表单元素相比,这个元素相对比较容易设置样式,使用常规的 CSS 就可以轻松设置它的盒模型、字体、颜色方案等。

    -

    Styling HTML forms 这个页面提供了一些关于 <textarea> 样式的有用提示。

    +

    Styling HTML forms 这个页面提供了一些关于 <textarea> 样式的有用提示。

    基线不一致

    @@ -190,8 +190,8 @@ textarea:valid {
    内容分类Flow contentphrasing contentinteractive contentlistedlabelableresettable, and submittable form-associated element内容分类Flow contentphrasing contentinteractive contentlistedlabelableresettable, and submittable form-associated element
    允许的内容
    允许的父元素Any element that accepts phrasing content.Any element that accepts phrasing content.
    Implicit ARIA role
    - - + + @@ -203,11 +203,11 @@ textarea:valid { - + - + diff --git a/files/zh-cn/web/html/element/video/index.html b/files/zh-cn/web/html/element/video/index.html index 83925c0882..350d9e4e41 100644 --- a/files/zh-cn/web/html/element/video/index.html +++ b/files/zh-cn/web/html/element/video/index.html @@ -214,7 +214,7 @@ translation_of: Web/HTML/Element/video - + diff --git a/files/zh-cn/web/html/global_attributes/data-_star_/index.html b/files/zh-cn/web/html/global_attributes/data-_star_/index.html index 59113524be..ed5adaae8f 100644 --- a/files/zh-cn/web/html/global_attributes/data-_star_/index.html +++ b/files/zh-cn/web/html/global_attributes/data-_star_/index.html @@ -8,7 +8,7 @@ translation_of: Web/HTML/Global_attributes/data-* ---

    {{HTMLSidebar("Global_attributes")}}

    -

    data-* 全局属性 是一类被称为自定义数据属性的属性,它赋予我们在所有 HTML 元素上嵌入自定义数据属性的能力,并可以通过脚本在 HTML 与 DOM 表现之间进行专有数据的交换。

    +

    data-* 全局属性 是一类被称为自定义数据属性的属性,它赋予我们在所有 HTML 元素上嵌入自定义数据属性的能力,并可以通过脚本在 HTML 与 DOM 表现之间进行专有数据的交换。

    {{EmbedInteractiveExample("pages/tabbed/attribute-data.html","tabbed-standard")}}
    diff --git a/files/zh-cn/web/html/global_attributes/hidden/index.html b/files/zh-cn/web/html/global_attributes/hidden/index.html index 507318c483..e7f9d451f0 100644 --- a/files/zh-cn/web/html/global_attributes/hidden/index.html +++ b/files/zh-cn/web/html/global_attributes/hidden/index.html @@ -104,5 +104,5 @@ translation_of: Web/HTML/Global_attributes/hidden diff --git a/files/zh-cn/web/http/cookies/index.html b/files/zh-cn/web/http/cookies/index.html index 08440c9d88..5b57de8dff 100644 --- a/files/zh-cn/web/http/cookies/index.html +++ b/files/zh-cn/web/http/cookies/index.html @@ -77,7 +77,7 @@ Cookie: yummy_cookie=choco; tasty_cookie=strawberry

    提示:当Cookie的过期时间被设定时,设定的日期和时间只与客户端相关,而不是服务端。

    -

    如果您的站点对用户进行身份验证,则每当用户进行身份验证时,它都应重新生成并重新发送会话 Cookie,甚至是已经存在的会话 Cookie。此技术有助于防止会话固定攻击(session fixation attacks),在该攻击中第三方可以重用用户的会话。

    +

    如果您的站点对用户进行身份验证,则每当用户进行身份验证时,它都应重新生成并重新发送会话 Cookie,甚至是已经存在的会话 Cookie。此技术有助于防止会话固定攻击(session fixation attacks),在该攻击中第三方可以重用用户的会话。

    @@ -89,7 +89,7 @@ Cookie: yummy_cookie=choco; tasty_cookie=strawberry

    从 Chrome 52 和 Firefox 52 开始,不安全的站点(http:)无法使用Cookie的 Secure 标记。

    -

    JavaScript {{domxref("Document.cookie")}} API 无法访问带有 HttpOnly 属性的cookie;此类 Cookie 仅作用于服务器。例如,持久化服务器端会话的 Cookie 不需要对 JavaScript 可用,而应具有 HttpOnly 属性。此预防措施有助于缓解跨站点脚本(XSS)攻击。

    +

    JavaScript {{domxref("Document.cookie")}} API 无法访问带有 HttpOnly 属性的cookie;此类 Cookie 仅作用于服务器。例如,持久化服务器端会话的 Cookie 不需要对 JavaScript 可用,而应具有 HttpOnly 属性。此预防措施有助于缓解跨站点脚本(XSS)攻击。

    示例:

    @@ -149,7 +149,7 @@ Cookie: yummy_cookie=choco; tasty_cookie=strawberry

    cookie 机制的使得服务器无法确认 cookie 是在安全来源上设置的,甚至无法确定 cookie 最初是在哪里设置的。

    -

    子域上的易受攻击的应用程序可以使用 Domain 属性设置 cookie,从而可以访问所有其他子域上的该 cookie。会话固定攻击中可能会滥用此机制。有关主要缓解方法,请参阅会话劫持( session fixation)

    +

    子域上的易受攻击的应用程序可以使用 Domain 属性设置 cookie,从而可以访问所有其他子域上的该 cookie。会话固定攻击中可能会滥用此机制。有关主要缓解方法,请参阅会话劫持( session fixation)

    但是,作为深度防御措施,可以使用 cookie 前缀来断言有关 cookie 的特定事实。有两个前缀可用:

    @@ -166,7 +166,7 @@ Cookie: yummy_cookie=choco; tasty_cookie=strawberry

    在应用程序服务器上,Web 应用程序必须检查完整的 cookie 名称,包括前缀 —— 用户代理程序在从请求的 {{HTTPHeader("Cookie")}} 标头中发送前缀之前,不会从 cookie 中剥离前缀。

    -

    有关 cookie 前缀和浏览器支持的当前状态的更多信息,请参阅 Prefixes section of the Set-Cookie reference article

    +

    有关 cookie 前缀和浏览器支持的当前状态的更多信息,请参阅 Prefixes section of the Set-Cookie reference article

    @@ -193,7 +193,7 @@ console.log(document.cookie);
    • 使用 HttpOnly 属性可防止通过 JavaScript 访问 cookie 值。
    • -
    • 用于敏感信息(例如指示身份验证)的 Cookie 的生存期应较短,并且 SameSite 属性设置为StrictLax。(请参见上方的 SameSite Cookie。)在支持 SameSite 的浏览器中,这样做的作用是确保不与跨域请求一起发送身份验证 cookie,因此,这种请求实际上不会向应用服务器进行身份验证。
    • +
    • 用于敏感信息(例如指示身份验证)的 Cookie 的生存期应较短,并且 SameSite 属性设置为StrictLax。(请参见上方的 SameSite Cookie。)在支持 SameSite 的浏览器中,这样做的作用是确保不与跨域请求一起发送身份验证 cookie,因此,这种请求实际上不会向应用服务器进行身份验证。

    会话劫持和 XSS

    @@ -272,9 +272,9 @@ console.log(document.cookie);

    在浏览器中存储信息的其他方式

    -

    在浏览器中存储数据的另一种方法是 Web Storage APIwindow.sessionStoragewindow.localStorage 属性与持续时间中的会话和永久 cookie 相对应,但是存储限制比 cookie大,并且永远不会发送到服务器。

    +

    在浏览器中存储数据的另一种方法是 Web Storage APIwindow.sessionStoragewindow.localStorage 属性与持续时间中的会话和永久 cookie 相对应,但是存储限制比 cookie大,并且永远不会发送到服务器。

    -

    可以使用 IndexedDB API 或基于它构建的库来存储更多结构化的数据。

    +

    可以使用 IndexedDB API 或基于它构建的库来存储更多结构化的数据。

    了解更多

    diff --git a/files/zh-cn/web/http/cors/errors/corsmissingallowcredentials/index.html b/files/zh-cn/web/http/cors/errors/corsmissingallowcredentials/index.html index c66cf9a519..55d8df8ba3 100644 --- a/files/zh-cn/web/http/cors/errors/corsmissingallowcredentials/index.html +++ b/files/zh-cn/web/http/cors/errors/corsmissingallowcredentials/index.html @@ -18,8 +18,8 @@ original_slug: Web/HTTP/CORS/Errors/CORS错误允许凭证
    • 如果要使用{{domxref("XMLHttpRequest")}}发出请求,请确保没有将{{domxref("XMLHttpRequest.withCredentials”,“ withCredentials")}}}设置为true。
    • -
    • 如果使用 Server-sent events,请确保{{domxref("EventSource.withCredentials")}}为false(default)。
    • -
    • 如果使用 Fetch API,请确保{{domxref("Request.credentials")}}为“omit”。
    • +
    • 如果使用 Server-sent events,请确保{{domxref("EventSource.withCredentials")}}为false(default)。
    • +
    • 如果使用 Fetch API,请确保{{domxref("Request.credentials")}}为“omit”。

    想要通过更改服务器的配置来消除此错误,请调整服务器的配置以将Access-Control-Allow-Credentials标头的值设置为true。

    diff --git a/files/zh-cn/web/http/headers/cache-control/index.html b/files/zh-cn/web/http/headers/cache-control/index.html index 397367f225..ec6bddf597 100644 --- a/files/zh-cn/web/http/headers/cache-control/index.html +++ b/files/zh-cn/web/http/headers/cache-control/index.html @@ -81,7 +81,7 @@ Cache-control: stale-if-error=<seconds>
    public
    -
    表明响应可以被任何对象(包括:发送请求的客户端,代理服务器,等等)缓存,即使是通常不可缓存的内容。(例如:1.该响应没有max-age指令或Expires消息头;2. 该响应对应的请求方法是 POST 。)
    +
    表明响应可以被任何对象(包括:发送请求的客户端,代理服务器,等等)缓存,即使是通常不可缓存的内容。(例如:1.该响应没有max-age指令或Expires消息头;2. 该响应对应的请求方法是 POST 。)
    private
    表明响应只能被单个用户缓存,不能作为共享缓存(即代理服务器不能缓存它)。私有缓存可以缓存响应内容,比如:对应用户的本地浏览器。
    no-cache
    diff --git a/files/zh-cn/web/http/headers/dpr/index.html b/files/zh-cn/web/http/headers/dpr/index.html index d4d577bdc0..d7a74581a2 100644 --- a/files/zh-cn/web/http/headers/dpr/index.html +++ b/files/zh-cn/web/http/headers/dpr/index.html @@ -5,7 +5,7 @@ translation_of: Web/HTTP/Headers/DPR ---
    {{HTTPSidebar}}{{securecontext_header}}{{SeeCompatTable}}
    -

    DPR请求头是“ 客户端提示”消息头,它代表客户端设备的像素比({{Glossary("DPR")}}),该比例是与每个CSS像素相对应的物理设备像素的数量。

    +

    DPR请求头是“ 客户端提示”消息头,它代表客户端设备的像素比({{Glossary("DPR")}}),该比例是与每个CSS像素相对应的物理设备像素的数量。

    Content categoriesFlow contentphrasing contentInteractive contentlistedlabelableresettable, and submittable form-associated element.Content categoriesFlow contentphrasing contentInteractive contentlistedlabelableresettable, and submittable form-associated element.
    Permitted content
    Permitted parentsAny element that accepts phrasing content.Any element that accepts phrasing content.
    Implicit ARIA roletextboxtextbox
    Permitted ARIA roles
    {{domxref("HTMLMediaElement.emptied_event", 'emptied')}}媒体内容为空;例如,当这个media已经加载完成(或者部分加载完成), load() 被用来进行重新加载。媒体内容为空;例如,当这个media已经加载完成(或者部分加载完成), load() 被用来进行重新加载。
    {{domxref("HTMLMediaElement.ended_event", 'ended')}}
    diff --git a/files/zh-cn/web/http/headers/set-cookie/samesite/index.html b/files/zh-cn/web/http/headers/set-cookie/samesite/index.html index 76bf8e9146..ca24138993 100644 --- a/files/zh-cn/web/http/headers/set-cookie/samesite/index.html +++ b/files/zh-cn/web/http/headers/set-cookie/samesite/index.html @@ -25,7 +25,7 @@ translation_of: Web/HTTP/Headers/Set-Cookie/SameSite

    以前 None 是默认值,但最近的浏览器版本将 Lax 作为默认值,以便对某些类型的跨站请求伪造 ({{Glossary("CSRF")}}) 攻击具有相当强的防御能力。

    -

    使用 None 时,需在最新的浏览器版本中使用 Secure 属性。更多信息见下文。

    +

    使用 None 时,需在最新的浏览器版本中使用 Secure 属性。更多信息见下文。

    针对常见警告信息的解决办法

    @@ -46,7 +46,7 @@ translation_of: Web/HTTP/Headers/Set-Cookie/SameSite
    Set-Cookie: flavor=choco; SameSite=None; Secure
    -

    Secure cookie仅通过HTTPS协议加密发送到服务器。请注意,不安全站点(http:)无法使用 Secure 指令设置cookies。

    +

    Secure cookie仅通过HTTPS协议加密发送到服务器。请注意,不安全站点(http:)无法使用 Secure 指令设置cookies。

    没有 SameSite 属性的Cookies默认为 SameSite=Lax

    diff --git a/files/zh-cn/web/http/redirections/index.html b/files/zh-cn/web/http/redirections/index.html index d2a879e475..a009739d50 100644 --- a/files/zh-cn/web/http/redirections/index.html +++ b/files/zh-cn/web/http/redirections/index.html @@ -30,9 +30,9 @@ translation_of: Web/HTTP/Redirections

    不同类型的重定向映射可以划分为三个类别:

      -
    1. 永久重定向
    2. -
    3. 临时重定向
    4. -
    5. 特殊重定向
    6. +
    7. 永久重定向
    8. +
    9. 临时重定向
    10. +
    11. 特殊重定向

    永久重定向

    @@ -237,7 +237,7 @@ translation_of: Web/HTTP/Redirections

    URL https://example.com/ 会被重定向至 https://www.example.com/ ,URL 下的任何文件或目录也将重定向到该 URL(https://example.com/some-page 将重定向至 https://www.example.com/some-page)。

    -

    Redirect_Match 指令的功能与之类似,不同之处在于它可以通过正则表达式来指定一批受影响的 URL :

    +

    Redirect_Match 指令的功能与之类似,不同之处在于它可以通过正则表达式来指定一批受影响的 URL :

    RedirectMatch ^/images/(.*)$ http://images.example.com/$1
    diff --git a/files/zh-cn/web/http/status/304/index.html b/files/zh-cn/web/http/status/304/index.html index 97dde661e6..d61cf2c4b2 100644 --- a/files/zh-cn/web/http/status/304/index.html +++ b/files/zh-cn/web/http/status/304/index.html @@ -44,7 +44,7 @@ translation_of: Web/HTTP/Status/304

    兼容性提醒

      -
    • 如果响应错误的携带了响应体,那么浏览器会有不同的行为,详情请见 204 No Content 。
    • +
    • 如果响应错误的携带了响应体,那么浏览器会有不同的行为,详情请见 204 No Content 。

    更多

    diff --git a/files/zh-cn/web/javascript/closures/index.html b/files/zh-cn/web/javascript/closures/index.html index 4c84f51dd9..9c14c74c62 100644 --- a/files/zh-cn/web/javascript/closures/index.html +++ b/files/zh-cn/web/javascript/closures/index.html @@ -331,7 +331,7 @@ setupHelp();

    这个例子使用let而不是var,因此每个闭包都绑定了块作用域的变量,这意味着不再需要额外的闭包。

    -

    另一个可选方案是使用 forEach()来遍历helpText数组并给每一个<p>添加一个监听器,如下所示:

    +

    另一个可选方案是使用 forEach()来遍历helpText数组并给每一个<p>添加一个监听器,如下所示:

    function showHelp(help) {
       document.getElementById('help').innerHTML = help;
    diff --git a/files/zh-cn/web/javascript/guide/regular_expressions/assertions/index.html b/files/zh-cn/web/javascript/guide/regular_expressions/assertions/index.html
    index a9ef01776b..2a80a615fe 100644
    --- a/files/zh-cn/web/javascript/guide/regular_expressions/assertions/index.html
    +++ b/files/zh-cn/web/javascript/guide/regular_expressions/assertions/index.html
    @@ -245,19 +245,19 @@ console.log(ripe_oranges); // [ 'ripe orange A ', 'ripe orange C' ]

    浏览器 兼容性

    -

    有关浏览器兼容性的信息,请查看 main Regular Expressions compatibility table.

    +

    有关浏览器兼容性的信息,请查看 main Regular Expressions compatibility table.

    另请参阅

    diff --git a/files/zh-cn/web/javascript/reference/classes/index.html b/files/zh-cn/web/javascript/reference/classes/index.html index 5c91d8d219..89045127bf 100644 --- a/files/zh-cn/web/javascript/reference/classes/index.html +++ b/files/zh-cn/web/javascript/reference/classes/index.html @@ -67,7 +67,7 @@ console.log(Rectangle.name); // 输出: "Rectangle2"
    -

    注意: 类表达式也同样受到类声明部分中提到的类型提升的限制。

    +

    注意: 类表达式也同样受到类声明部分中提到的类型提升的限制。

    类体和方法定义

    diff --git a/files/zh-cn/web/javascript/reference/functions/arguments/index.html b/files/zh-cn/web/javascript/reference/functions/arguments/index.html index 22ec42ac8f..937a5f7e7c 100644 --- a/files/zh-cn/web/javascript/reference/functions/arguments/index.html +++ b/files/zh-cn/web/javascript/reference/functions/arguments/index.html @@ -26,11 +26,11 @@ translation_of: Web/JavaScript/Reference/Functions/arguments

    描述

    -

    Note: If you're writing ES6 compatible code, then rest parameters should be preferred.

    +

    Note: If you're writing ES6 compatible code, then rest parameters should be preferred.

    -

    Note: “Array-like” means that arguments has a {{jsxref("Functions/arguments/length", "length")}} property and properties indexed from zero, but it doesn't have {{JSxRef("Array")}}'s built-in methods like {{jsxref("Array.forEach", "forEach()")}} and {{jsxref("Array.map", "map()")}}. See §Description for details.

    +

    Note: “Array-like” means that arguments has a {{jsxref("Functions/arguments/length", "length")}} property and properties indexed from zero, but it doesn't have {{JSxRef("Array")}}'s built-in methods like {{jsxref("Array.forEach", "forEach()")}} and {{jsxref("Array.map", "map()")}}. See §Description for details.

    arguments对象是所有(非箭头)函数中都可用的局部变量。你可以使用arguments对象在函数中引用函数的参数。此对象包含传递给函数的每个参数,第一个参数在索引0处。例如,如果一个函数传递了三个参数,你可以以如下方式引用他们:

    diff --git a/files/zh-cn/web/javascript/reference/global_objects/bigint/index.html b/files/zh-cn/web/javascript/reference/global_objects/bigint/index.html index 1ef191efc0..225cda75d6 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/bigint/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/bigint/index.html @@ -161,7 +161,7 @@ Boolean(12n)

    构造器

    -
    BigInt()
    +
    BigInt()
    创建{{jsxref("BigInt")}} 对象。
    diff --git a/files/zh-cn/web/javascript/reference/global_objects/bigint64array/index.html b/files/zh-cn/web/javascript/reference/global_objects/bigint64array/index.html index c7f47fef77..31ac75a13e 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/bigint64array/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/bigint64array/index.html @@ -11,7 +11,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/BigInt64Array

    构造函数

    -

    BigInt64Array()

    +

    BigInt64Array()

         添加一个新的BigInt64Array对象。

    @@ -167,7 +167,7 @@ var bigint64 = new BigInt64Array(iterable);

    参考

    diff --git a/files/zh-cn/web/javascript/reference/global_objects/boolean/index.html b/files/zh-cn/web/javascript/reference/global_objects/boolean/index.html index 9b0ba4ae06..a236f20273 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/boolean/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/boolean/index.html @@ -51,13 +51,13 @@ var s = new Boolean(myString); // true

    最后,不要在应该使用基本类型布尔值的地方使用 Boolean 对象。

    -

    注意:当将非标准属性document.all用作此构造函数的参数时,结果是值为false的布尔对象。 此属性是旧属性,是非标准属性,不应使用。

    +

    注意:当将非标准属性document.all用作此构造函数的参数时,结果是值为false的布尔对象。 此属性是旧属性,是非标准属性,不应使用。

    构造器

    -
    Boolean()
    +
    Boolean()
    创建一个新的Boolean 对象。
    diff --git a/files/zh-cn/web/javascript/reference/global_objects/encodeuricomponent/index.html b/files/zh-cn/web/javascript/reference/global_objects/encodeuricomponent/index.html index d80cd457c9..be7f03a446 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/encodeuricomponent/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/encodeuricomponent/index.html @@ -9,7 +9,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/encodeURIComponent ---
    {{jsSidebar("Objects")}}
    -

    encodeURIComponent()函数通过将一个,两个,三个或四个表示字符的UTF-8编码的转义序列替换某些字符的每个实例来编码 URI (对于由两个“代理”字符组成的字符而言,将仅是四个转义序列) 。

    +

    encodeURIComponent()函数通过将一个,两个,三个或四个表示字符的UTF-8编码的转义序列替换某些字符的每个实例来编码 URI (对于由两个“代理”字符组成的字符而言,将仅是四个转义序列) 。

    {{EmbedInteractiveExample("pages/js/globalprops-encodeuricomponent.html","shorter")}}

    diff --git a/files/zh-cn/web/javascript/reference/global_objects/globalthis/index.html b/files/zh-cn/web/javascript/reference/global_objects/globalthis/index.html index 20b6dba280..7260d8cbfa 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/globalthis/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/globalthis/index.html @@ -30,7 +30,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/globalThis

    在以前,从不同的 JavaScript 环境中获取全局对象需要不同的语句。在 Web 中,可以通过 windowself 或者 frames 取到全局对象,但是在 Web Workers 中,只有 self 可以。在 Node.js 中,它们都无法获取,必须使用 global

    -

    在松散模式下,可以在函数中返回 this 来获取全局对象,但是在严格模式和模块环境下,this 会返回 undefined。 You can also use Function('return this')(), but environments that disable {{jsxref("eval", "eval()")}}, like CSP in browsers, prevent use of {{jsxref("Function")}} in this way.

    +

    在松散模式下,可以在函数中返回 this 来获取全局对象,但是在严格模式和模块环境下,this 会返回 undefined。 You can also use Function('return this')(), but environments that disable {{jsxref("eval", "eval()")}}, like CSP in browsers, prevent use of {{jsxref("Function")}} in this way.

    globalThis 提供了一个标准的方式来获取不同环境下的全局 this  对象(也就是全局对象自身)。不像 window 或者 self 这些属性,它确保可以在有无窗口的各种环境下正常工作。所以,你可以安心的使用 globalThis,不必担心它的运行环境。为便于记忆,你只需要记住,全局作用域中的 this 就是 globalThis

    diff --git a/files/zh-cn/web/javascript/reference/global_objects/math/random/index.html b/files/zh-cn/web/javascript/reference/global_objects/math/random/index.html index ea760c65f6..efc11b6894 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/math/random/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/math/random/index.html @@ -90,5 +90,5 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Math/random

    相关链接

    diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/assign/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/assign/index.html index abe605e620..1e1080be00 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/object/assign/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/object/assign/index.html @@ -51,7 +51,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Object/assign

    Polyfill

    -

    这个 polyfill 不支持 symbol 属性, 由于 ES5 中本来就不存在 symbols :

    +

    这个 polyfill 不支持 symbol 属性, 由于 ES5 中本来就不存在 symbols :

    if (typeof Object.assign !== 'function') {
       // Must be writable: true, enumerable: false, configurable: true
    diff --git a/files/zh-cn/web/javascript/reference/global_objects/promise/allsettled/index.html b/files/zh-cn/web/javascript/reference/global_objects/promise/allsettled/index.html
    index 919da6e0b8..d552f10680 100644
    --- a/files/zh-cn/web/javascript/reference/global_objects/promise/allsettled/index.html
    +++ b/files/zh-cn/web/javascript/reference/global_objects/promise/allsettled/index.html
    @@ -59,11 +59,11 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Promise/allSettled
     
     
    diff --git a/files/zh-cn/web/javascript/reference/global_objects/reflect/index.html b/files/zh-cn/web/javascript/reference/global_objects/reflect/index.html
    index b35fe77d5c..4b430c4772 100644
    --- a/files/zh-cn/web/javascript/reference/global_objects/reflect/index.html
    +++ b/files/zh-cn/web/javascript/reference/global_objects/reflect/index.html
    @@ -10,13 +10,13 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Reflect
     ---
     
    {{JSRef}}
    -

    Reflect 是一个内置的对象,它提供拦截 JavaScript 操作的方法。这些方法与proxy handlers的方法相同。Reflect不是一个函数对象,因此它是不可构造的。

    +

    Reflect 是一个内置的对象,它提供拦截 JavaScript 操作的方法。这些方法与proxy handlers的方法相同。Reflect不是一个函数对象,因此它是不可构造的。

    描述

    与大多数全局对象不同Reflect并非一个构造函数,所以不能通过new运算符对其进行调用,或者将Reflect对象作为一个函数来调用。Reflect的所有属性和方法都是静态的(就像{{jsxref("Math")}}对象)。

    -

    Reflect 对象提供了以下静态方法,这些方法与proxy handler methods的命名相同.

    +

    Reflect 对象提供了以下静态方法,这些方法与proxy handler methods的命名相同.

    其中的一些方法与 {{jsxref("Object")}}相同, 尽管二者之间存在 某些细微上的差别 .

    diff --git a/files/zh-cn/web/javascript/reference/global_objects/regexp/index.html b/files/zh-cn/web/javascript/reference/global_objects/regexp/index.html index 27da890c46..2a1e6ffcf5 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/regexp/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/regexp/index.html @@ -200,7 +200,7 @@ console.log(regex.lastIndex); // prints "15" // and so on
    -

    Unicode属性转义特性引入了一种解决方案,它允许使用像\p{scx=Cyrl}这样简单的语句。这里有一个外部资源,用来获取 Unicode 中的不同区块范围:Regexp-unicode-block

    +

    Unicode属性转义特性引入了一种解决方案,它允许使用像\p{scx=Cyrl}这样简单的语句。这里有一个外部资源,用来获取 Unicode 中的不同区块范围:Regexp-unicode-block

    从 URL 中提取子域名

    diff --git a/files/zh-cn/web/javascript/reference/global_objects/set/index.html b/files/zh-cn/web/javascript/reference/global_objects/set/index.html index 49ede8bf54..3e8c53dc64 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/set/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/set/index.html @@ -26,7 +26,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Set

    Constructor

    -
    Set()
    +
    Set()
    创建一个新的Set对象。
    diff --git a/files/zh-cn/web/javascript/reference/operators/inequality/index.html b/files/zh-cn/web/javascript/reference/operators/inequality/index.html index 867bda689f..dfa41522d1 100644 --- a/files/zh-cn/web/javascript/reference/operators/inequality/index.html +++ b/files/zh-cn/web/javascript/reference/operators/inequality/index.html @@ -22,19 +22,19 @@ translation_of: Web/JavaScript/Reference/Operators/Inequality

    描述

    -

    不等式运算符检查其操作数是否不相等。这是等于运算符的取反,因此以下两行将始终给出相同的结果: 

    +

    不等式运算符检查其操作数是否不相等。这是等于运算符的取反,因此以下两行将始终给出相同的结果: 

    x != y
     
     !(x == y)
    -

    有关比较算法的详细信息,请参见等于运算符的页面

    +

    有关比较算法的详细信息,请参见等于运算符的页面

    与等于运算符一样,不等于运算符将尝试转换和比较不同类型的操作数:

    3 != "3"; // false
    -

    为避免这种情况,并要求将不同类型视为不同,请使用严格的不等于运算符:

    +

    为避免这种情况,并要求将不同类型视为不同,请使用严格的不等于运算符:

    3 !== "3"; // true
    @@ -94,9 +94,9 @@ object2 != object2 // false

    参见

    diff --git a/files/zh-cn/web/javascript/reference/operators/optional_chaining/index.html b/files/zh-cn/web/javascript/reference/operators/optional_chaining/index.html index 2c91f70141..6f639f537a 100644 --- a/files/zh-cn/web/javascript/reference/operators/optional_chaining/index.html +++ b/files/zh-cn/web/javascript/reference/operators/optional_chaining/index.html @@ -16,7 +16,7 @@ original_slug: Web/JavaScript/Reference/Operators/可选链 ---
    {{JSSidebar("Operators")}}
    -

    可选链操作符( ?. )允许读取位于连接对象链深处的属性的值,而不必明确验证链中的每个引用是否有效。?. 操作符的功能类似于 . 链式操作符,不同之处在于,在引用为空(nullish ) ({{JSxRef("null")}} 或者 {{JSxRef("undefined")}}) 的情况下不会引起错误,该表达式短路返回值是 undefined。与函数调用一起使用时,如果给定的函数不存在,则返回 undefined

    +

    可选链操作符( ?. )允许读取位于连接对象链深处的属性的值,而不必明确验证链中的每个引用是否有效。?. 操作符的功能类似于 . 链式操作符,不同之处在于,在引用为空(nullish ) ({{JSxRef("null")}} 或者 {{JSxRef("undefined")}}) 的情况下不会引起错误,该表达式短路返回值是 undefined。与函数调用一起使用时,如果给定的函数不存在,则返回 undefined

    当尝试访问可能不存在的对象属性时,可选链操作符将会使表达式更短、更简明。在探索一个对象的内容时,如果不能确定哪些属性必定存在,可选链操作符也是很有帮助的。

    diff --git a/files/zh-cn/web/javascript/reference/operators/this/index.html b/files/zh-cn/web/javascript/reference/operators/this/index.html index 6ea1eb67c6..a53b49cb60 100644 --- a/files/zh-cn/web/javascript/reference/operators/this/index.html +++ b/files/zh-cn/web/javascript/reference/operators/this/index.html @@ -14,7 +14,7 @@ translation_of: Web/JavaScript/Reference/Operators/this

    与其他语言相比,函数的 this 关键字在 JavaScript 中的表现略有不同,此外,在严格模式和非严格模式之间也会有一些差别。

    -

    在绝大多数情况下,函数的调用方式决定了 this 的值(运行时绑定)。this 不能在执行期间被赋值,并且在每次函数被调用时 this 的值也可能会不同。ES5 引入了 bind 方法来设置函数的 this 值,而不用考虑函数如何被调用的。ES2015 引入了箭头函数,箭头函数不提供自身的 this 绑定(this 的值将保持为闭合词法上下文的值)。

    +

    在绝大多数情况下,函数的调用方式决定了 this 的值(运行时绑定)。this 不能在执行期间被赋值,并且在每次函数被调用时 this 的值也可能会不同。ES5 引入了 bind 方法来设置函数的 this 值,而不用考虑函数如何被调用的。ES2015 引入了箭头函数,箭头函数不提供自身的 this 绑定(this 的值将保持为闭合词法上下文的值)。

    {{EmbedInteractiveExample("pages/js/expressions-this.html")}}

    diff --git a/files/zh-cn/web/javascript/reference/statements/import/index.html b/files/zh-cn/web/javascript/reference/statements/import/index.html index fabebc11d1..b7634d9cef 100644 --- a/files/zh-cn/web/javascript/reference/statements/import/index.html +++ b/files/zh-cn/web/javascript/reference/statements/import/index.html @@ -136,7 +136,7 @@ var promise = import("module-name");//这是一个处于第三阶段的提案。
  • 当被导入的模块有副作用(这里说的副作用,可以理解为模块中会直接运行的代码),这些副作用只有在触发了某些条件才被需要时。(原则上来说,模块不能有副作用,但是很多时候,你无法控制你所依赖的模块的内容)
  • -

    请不要滥用动态导入(只有在必要情况下采用)。静态框架能更好的初始化依赖,而且更有利于静态分析工具和tree shaking发挥作用

    +

    请不要滥用动态导入(只有在必要情况下采用)。静态框架能更好的初始化依赖,而且更有利于静态分析工具和tree shaking发挥作用

    关键字import可以像调用函数一样来动态的导入模块。以这种方式调用,将返回一个 promise

    diff --git a/files/zh-cn/web/mathml/element/mrow/index.html b/files/zh-cn/web/mathml/element/mrow/index.html index b735b70dd6..9867445730 100644 --- a/files/zh-cn/web/mathml/element/mrow/index.html +++ b/files/zh-cn/web/mathml/element/mrow/index.html @@ -24,7 +24,7 @@ translation_of: Web/MathML/Element/mrow
    class, id, style
    -
    用来供样式表使用。
    +
    用来供样式表使用。
    dir
    行内公式的书写方向。可能的值为 ltr(自左向右)或 rtl(自右向左)。
    href
    diff --git a/files/zh-cn/web/performance/dns-prefetch/index.html b/files/zh-cn/web/performance/dns-prefetch/index.html index f6674818a6..155cdf100c 100644 --- a/files/zh-cn/web/performance/dns-prefetch/index.html +++ b/files/zh-cn/web/performance/dns-prefetch/index.html @@ -10,9 +10,9 @@ translation_of: Web/Performance/dns-prefetch

    为什么要使用 dns-prefetch?

    -

    当浏览器从(第三方)服务器请求资源时,必须先将该跨域域名解析为 IP地址,然后浏览器才能发出请求。此过程称为 DNS解析。DNS 缓存可以帮助减少此延迟,而 DNS解析可以导致请求增加明显的延迟。对于打开了与许多第三方的连接的网站,此延迟可能会大大降低加载性能。

    +

    当浏览器从(第三方)服务器请求资源时,必须先将该跨域域名解析为 IP地址,然后浏览器才能发出请求。此过程称为 DNS解析。DNS 缓存可以帮助减少此延迟,而 DNS解析可以导致请求增加明显的延迟。对于打开了与许多第三方的连接的网站,此延迟可能会大大降低加载性能。

    -

    dns-prefetch 可帮助开发人员掩盖 DNS解析延迟。 HTML <link>元素 通过 dns-prefetch的 rel 属性值提供此功能。然后在 href属性中指要跨域的域名:

    +

    dns-prefetch 可帮助开发人员掩盖 DNS解析延迟。 HTML <link>元素 通过 dns-prefetch的 rel 属性值提供此功能。然后在 href属性中指要跨域的域名:

    句法

    @@ -30,19 +30,19 @@ translation_of: Web/Performance/dns-prefetch </body> </html> -

    每当站点引用跨域域上的资源时,都应在 <head> 元素中放置 dns-prefetch提示,但是要记住一些注意事项。

    +

    每当站点引用跨域域上的资源时,都应在 <head> 元素中放置 dns-prefetch提示,但是要记住一些注意事项。

    最佳实践

    请记住以下三点:

    -

    首先,dns-prefetch 仅对跨域域上的 DNS查找有效,因此请避免使用它来指向您的站点或域。这是因为,到浏览器看到提示时,您站点域背后的IP已经被解析。

    +

    首先,dns-prefetch 仅对跨域域上的 DNS查找有效,因此请避免使用它来指向您的站点或域。这是因为,到浏览器看到提示时,您站点域背后的IP已经被解析。

    -

    其次,还可以通过使用 HTTP链接字段dns-prefetch(以及其他资源提示)指定为 HTTP标头

    +

    其次,还可以通过使用 HTTP链接字段dns-prefetch(以及其他资源提示)指定为 HTTP标头

    Link: <https://fonts.gstatic.com/>; rel=dns-prefetch
    -

    第三,考虑将 dns-prefetchpreconnect(预连接)提示配对。尽管 dns-prefetch 仅执行 DNS查找,但preconnect 会建立与服务器的连接。如果站点是通过HTTPS服务的,则此过程包括DNS解析,建立TCP连接以及执行TLS握手。将两者结合起来可提供进一步减少跨域请求的感知延迟的机会。您可以安全地将它们一起使用,如下所示:

    +

    第三,考虑将 dns-prefetchpreconnect(预连接)提示配对。尽管 dns-prefetch 仅执行 DNS查找,但preconnect 会建立与服务器的连接。如果站点是通过HTTPS服务的,则此过程包括DNS解析,建立TCP连接以及执行TLS握手。将两者结合起来可提供进一步减少跨域请求的感知延迟的机会。您可以安全地将它们一起使用,如下所示:

    <link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin>
     <link rel="dns-prefetch" href="https://fonts.gstatic.com/">
    @@ -54,15 +54,15 @@ translation_of: Web/Performance/dns-prefetch
     
     

    配对这些提示的逻辑是因为对dns-prefetch的支持比对预连接的支持要好。不支持预连接的浏览器仍然可以通过回退到dns-prefetch来获得更多好处。由于这是HTML功能,因此非常容错。如果不支持的浏览器遇到dns-prefetch提示(或任何其他资源提示),则您的网站不会中断。您只是不会获得它提供的好处。

    -

    一些资源(如字体)以匿名模式加载。在这种情况下,应使用预连接提示设置 crossorigin 属性。如果您省略它,则浏览器将仅执行DNS查找。

    +

    一些资源(如字体)以匿名模式加载。在这种情况下,应使用预连接提示设置 crossorigin 属性。如果您省略它,则浏览器将仅执行DNS查找。

    查看更多

    diff --git a/files/zh-cn/web/performance/lazy_loading/index.html b/files/zh-cn/web/performance/lazy_loading/index.html index 6399c43e0f..4d8a013441 100644 --- a/files/zh-cn/web/performance/lazy_loading/index.html +++ b/files/zh-cn/web/performance/lazy_loading/index.html @@ -9,7 +9,7 @@ tags: - 懒加载 translation_of: Web/Performance/Lazy_loading --- -

    延迟加载(懒加载) 是一种将资源标识为非阻塞(非关键)资源并仅在需要时加载它们的策略。 这是一种缩短关键渲染路径长度的方法,可以缩短页面加载时间。

    +

    延迟加载(懒加载) 是一种将资源标识为非阻塞(非关键)资源并仅在需要时加载它们的策略。 这是一种缩短关键渲染路径长度的方法,可以缩短页面加载时间。

    延迟加载可以在应用程序的不同时刻发生,但通常会在某些用户交互(例如滚动和导航)上发生。

    diff --git a/files/zh-cn/web/progressive_web_apps/add_to_home_screen/index.html b/files/zh-cn/web/progressive_web_apps/add_to_home_screen/index.html index 0f347f2b7b..36bd26cd3a 100644 --- a/files/zh-cn/web/progressive_web_apps/add_to_home_screen/index.html +++ b/files/zh-cn/web/progressive_web_apps/add_to_home_screen/index.html @@ -114,9 +114,9 @@ original_slug: Web/Progressive_web_apps/添加到主屏幕

    A2HS 不提供什么?

    -

    请记住,将应用程序添加到主屏幕时,它只会使该应用程序易于访问,而不会将应用程序的资料和数据下载到您的设备上,也不会使该应用程序脱机使用或类似的操作。为了使应用离线运行,你必须使用 Service Worker API 来离线存储资源,如果需要,还可以使用 Web Storage 或 IndexedDB 来存储其数据。

    +

    请记住,将应用程序添加到主屏幕时,它只会使该应用程序易于访问,而不会将应用程序的资料和数据下载到您的设备上,也不会使该应用程序脱机使用或类似的操作。为了使应用离线运行,你必须使用 Service Worker API 来离线存储资源,如果需要,还可以使用 Web Storage 或 IndexedDB 来存储其数据。

    -

    在示例应用程序中,我们仅使用了一个service worker来存储所有必需的文件。service worker使用index.js 文件中的最终的代码块在网站上注册。然后,我们使用 Cache API 缓存网站的所有资产,并使用 sw.js 文件中的代码从缓存而不是网络中为它们提供服务。

    +

    在示例应用程序中,我们仅使用了一个service worker来存储所有必需的文件。service worker使用index.js 文件中的最终的代码块在网站上注册。然后,我们使用 Cache API 缓存网站的所有资产,并使用 sw.js 文件中的代码从缓存而不是网络中为它们提供服务。

    桌面上的_A2HS

    diff --git a/files/zh-cn/web/security/securing_your_site/turning_off_form_autocompletion/index.html b/files/zh-cn/web/security/securing_your_site/turning_off_form_autocompletion/index.html index fe8e97cdef..736645bc99 100644 --- a/files/zh-cn/web/security/securing_your_site/turning_off_form_autocompletion/index.html +++ b/files/zh-cn/web/security/securing_your_site/turning_off_form_autocompletion/index.html @@ -68,6 +68,6 @@ translation_of: Web/Security/Securing_your_site/Turning_off_form_autocompletion

    如果你定义了一个用户管理页面,其中用户可以为其他人指定新的密码,因此你想阻止密码字段的自动填充,你可以使用 autocomplete="new-password"

    -

    这只是一个提示,浏览器不一定要遵守。但现代浏览器都已停止在设置了 autocomplete="new-password" 的 <input> 元素上使用自动填充。例如,Firefox 67 版(见 {{bug(1119063)}})在这种情况下会停止自动填充;而 Firefox 70版(见 {{bug(1565407)}})则可以建议一个安全生成的密码,而不自动填充已保存的密码。更多细节参见  autocomplete compat table

    +

    这只是一个提示,浏览器不一定要遵守。但现代浏览器都已停止在设置了 autocomplete="new-password" 的 <input> 元素上使用自动填充。例如,Firefox 67 版(见 {{bug(1119063)}})在这种情况下会停止自动填充;而 Firefox 70版(见 {{bug(1565407)}})则可以建议一个安全生成的密码,而不自动填充已保存的密码。更多细节参见  autocomplete compat table

    {{QuickLinksWithSubpages("/en-US/docs/Web/Security")}}

    diff --git a/files/zh-cn/web/svg/attribute/marker-start/index.html b/files/zh-cn/web/svg/attribute/marker-start/index.html index 00ed2c1284..23b5ea6d6d 100644 --- a/files/zh-cn/web/svg/attribute/marker-start/index.html +++ b/files/zh-cn/web/svg/attribute/marker-start/index.html @@ -5,9 +5,9 @@ translation_of: Web/SVG/Attribute/marker-start ---
    {{SVGRef}}
    -

    marker-start 属性将在给定形状的起始顶点绘制的箭头或者多边形标记

    +

    marker-start 属性将在给定形状的起始顶点绘制的箭头或者多边形标记

    -

    对于除SVG的polyline和path元素之外的所有形状元素,最后的一个顶点与第一个顶点相同。在这种情况下,如果SVG的marker-start属性和 {{SVGAttr("marker-end")}} 的值都不是 none ,然后再最后一个顶点渲染两个图标。 对于一个 <path> 元素, 对于每个封闭的子路径,他的最后一个顶点都与第一个顶点相同。 marker-end 仅在路径数据的起始顶点上呈现。

    +

    对于除SVG的polyline和path元素之外的所有形状元素,最后的一个顶点与第一个顶点相同。在这种情况下,如果SVG的marker-start属性和 {{SVGAttr("marker-end")}} 的值都不是 none ,然后再最后一个顶点渲染两个图标。 对于一个 <path> 元素, 对于每个封闭的子路径,他的最后一个顶点都与第一个顶点相同。 marker-end 仅在路径数据的起始顶点上呈现。

    Note:作为一个图像属性, marker-start 可以用作css属性.

    @@ -61,7 +61,7 @@ translation_of: Web/SVG/Attribute/marker-start
    none
    表示将不会在起点绘制任何符号。
    <marker-ref>
    -
    这个值表示的是对 <marker> 元素的引用, 将在起点绘制该元素.。如果引用无效,将不会绘制任何东西。
    +
    这个值表示的是对 <marker> 元素的引用, 将在起点绘制该元素.。如果引用无效,将不会绘制任何东西。

    技术指标

    diff --git a/files/zh-cn/web/svg/element/animate/index.html b/files/zh-cn/web/svg/element/animate/index.html index 3151843fe0..3c7e98145a 100644 --- a/files/zh-cn/web/svg/element/animate/index.html +++ b/files/zh-cn/web/svg/element/animate/index.html @@ -58,13 +58,13 @@ translation_of: Web/SVG/Element/animate

    Blinking and flashing animation can be problematic for people with cognitive concerns such as Attention Deficit Hyperactivity Disorder (ADHD). Additionally, certain kinds of motion can be a trigger for Vestibular disorders, epilepsy, and migraine and Scotopic sensitivity.

    -

    Consider providing a mechanism for pausing or disabling animation, as well as using the Reduced Motion Media Query to create a complimentary experience for users who have expressed a preference for no animated experiences.

    +

    Consider providing a mechanism for pausing or disabling animation, as well as using the Reduced Motion Media Query to create a complimentary experience for users who have expressed a preference for no animated experiences.

    diff --git a/files/zh-cn/web/xml/xml_introduction/index.html b/files/zh-cn/web/xml/xml_introduction/index.html index b4c2a8a0db..bd8d02793c 100644 --- a/files/zh-cn/web/xml/xml_introduction/index.html +++ b/files/zh-cn/web/xml/xml_introduction/index.html @@ -49,7 +49,7 @@ translation_of: Web/XML/XML_introduction
    • 文档必须是一个格式良好的文档。
    • 文档遵循 XML 所有的语法规则并且有效。
    • -
    • 文档遵循特定语义的规则,这些规则通常规定在 XML 或 DTD 规范中(Document Type Definition)。
    • +
    • 文档遵循特定语义的规则,这些规则通常规定在 XML 或 DTD 规范中(Document Type Definition)。

    XML 示例

    @@ -132,7 +132,7 @@ translation_of: Web/XML/XML_introduction

    XML 通常被用作描述,但是还有很多方法去展示 XML 数据。如果你不定义一个让XML 展示的特别方式,那么原始的 XML 会被展现在浏览器上。

    -

    一个展示 XML 输出的方法是将 CSS 应用于文档,用 xml-stylesheet 去处理指令。

    +

    一个展示 XML 输出的方法是将 CSS 应用于文档,用 xml-stylesheet 去处理指令。

    <?xml-stylesheet type="text/css" href="stylesheet.css"?>
    -- cgit v1.2.3-54-g00ecf