From 97065b2e68dd8768dc1ea092c893c57ebe205026 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Thu, 25 Feb 2021 08:31:36 -0500 Subject: use class="hidden" not style="display:none" --- files/zh-cn/web/html/element/iframe/index.html | 4 ++-- files/zh-cn/web/html/element/input/number/index.html | 3 +-- files/zh-cn/web/html/global_attributes/index.html | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) (limited to 'files/zh-cn/web/html') diff --git a/files/zh-cn/web/html/element/iframe/index.html b/files/zh-cn/web/html/element/iframe/index.html index c25323e8f6..f67d286d24 100644 --- a/files/zh-cn/web/html/element/iframe/index.html +++ b/files/zh-cn/web/html/element/iframe/index.html @@ -134,10 +134,10 @@ translation_of: Web/HTML/Element/iframe -

非标准属性 {{non-standard_inline}}  

+

非标准属性 {{non-standard_inline}}

-
{{htmlattrdef("mozbrowser")}} {{non-standard_inline}}  
+
{{htmlattrdef("mozbrowser")}} {{non-standard_inline}}
diff --git a/files/zh-cn/web/html/element/input/number/index.html b/files/zh-cn/web/html/element/input/number/index.html index ef7aec6323..4baa8ba6ee 100644 --- a/files/zh-cn/web/html/element/input/number/index.html +++ b/files/zh-cn/web/html/element/input/number/index.html @@ -233,7 +233,6 @@ input:valid+span:after { <input id="meters" type="number" name="meters" step="0.01" min="0" placeholder="e.g. 1.78" required> <span class="validity"></span> </div> - <div class="feetInputGroup" style="display: none;"> <span>Enter your height — </span> <label for="feet">feet:</label> <input id="feet" type="number" name="feet" min="0" step="1"> @@ -252,7 +251,7 @@ input:valid+span:after {

You'll see that we are using many of the attributes we've already looked at in the article earlier on. Since we want to accept a meter value in centimeters, we've set the step value to 0.01, so that values like 1.78 are not seen as invalid. We've also provided a placeholder for that input.

-

We've hidden the feet and inches inputs initially using style="display: none;" so that meters is the default entry type.

+

We've hidden the feet and inches inputs initially using class="hidden" so that meters is the default entry type.

Now on to the CSS — this looks very similar to the validation styling we saw before; nothing remarkable here:

diff --git a/files/zh-cn/web/html/global_attributes/index.html b/files/zh-cn/web/html/global_attributes/index.html index 86a17db9f7..3654265669 100644 --- a/files/zh-cn/web/html/global_attributes/index.html +++ b/files/zh-cn/web/html/global_attributes/index.html @@ -22,7 +22,7 @@ translation_of: Web/HTML/Global_attributes
  • 事件处理程序 属性:onabortonautocompleteonautocompleteerroronbluroncanceloncanplayoncanplaythroughonchangeonclickoncloseoncontextmenuoncuechangeondblclickondragondragendondragenterondragexitondragleaveondragoverondragstartondropondurationchangeonemptiedonendedonerroronfocusoninputoninvalidonkeydownonkeypressonkeyuponloadonloadeddataonloadedmetadataonloadstartonmousedownonmouseenteronmouseleaveonmousemoveonmouseoutonmouseoveronmouseuponmousewheelonpauseonplayonplayingonprogressonratechangeonresetonresizeonscrollonseekedonseekingonselectonshowonsortonstalledonsubmitonsuspendontimeupdateontoggleonvolumechangeonwaiting.
  • -

    全局属性列表  

    +

    全局属性列表

    -- cgit v1.2.3-54-g00ecf