Get the App
SLTechnology News&Howtos  ›  Development  › 

Example Analysis of Boolean attribute hidden in html5

Shulou Source: shulou.com Published: 2022-06-03 15:04:13 09月30日 Update

This article mainly introduces the example analysis of Boolean attribute hidden in html5, which is very detailed and has certain reference value. Friends who are interested must finish it!

Example

Hidden paragraphs:

This paragraph should be hidden.

Browser support

IE

Firefox

Chrome

Safari

Opera

All major browsers support the hidden attribute, except Internet Explorer.

Definition and usage

The hidden property is a Boolean property.

If you set this attribute, it states that the element is still not or no longer relevant.

Browsers should not display elements that have a hidden attribute specified.

The hidden attribute can also be used to prevent users from viewing elements until certain conditions are matched (for example, a check box is selected). JavaScript can then delete the hidden attribute to make the element visible.

Differences between HTML 4.01 and HTML5

The hidden property is a new property in HTML5.

The difference between HTML and XHTML

In XHTML, property shorthand is prohibited, and the hidden property must be defined as.

Grammar

HTML5 brings us a lot of very simple but powerful HTML properties: placeholder, download, and autofocus, and so on. Another new attribute is the hidden property. When a web page element has a hidden attribute, its behavior is very similar to the display: none; function of CSS. The element will disappear and does not take up any page space. The way to write it is simple:

You can't see me!

If you are using an older browser that does not support this attribute, you can add the following code to CSS to support it:

* [hidden] {display: none;} these are all the contents of the article "sample Analysis of Boolean attributes hidden in html5". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Tags: Attributes elements browsers support browsing Boolean examples analysis between content differences paragraphs articles powerful similar mainstream code value role interest Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info OPPO Reno Linux Shulou Technology NVidia