HTML5 hidden attributes are compatible with old browsers

Source: Internet
Author: User

Comments: HTML5 brings us a lot of simple but powerful HTML attributes: placeholder, download, and autofocus. Another new attribute is the hidden attribute. When a webpage element has the hidden attribute, it performs very similar to the display: none of CSS, And the element disappears without occupying any page space. The statement is simple:

The Code is as follows:
<Div hidden>
You can't see me!
</Div>
If you are using an old-fashioned browser that does not support this attribute, you can add the following code in CSS to support it ::

The Code is as follows:
* [Hidden] {display: none ;}

So why should we use the hidden attribute? The meaning is that it is more meaningful in semantics and enhances the readability of the Code. It is simpler than display: none in CSS!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.