Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of Boolean attribute hidden in html5

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report