HTML5 New hidden Attribute

September 22nd, 2012 by Laeeq | No comments

HTML5 has provide us with useful and magical HTML attribute: placeholder and many more.

There is another new attribute introduces by HTML5, that’s hidden atribute. This atribute functions just like CSS “display:none;”. According to HTML5 specification, any element which has the hidden attribute should be considered irrelevant and thus should not be rendered by the browser. It’s simply like this:

  1. <section hidden>
  2. <p>
  3. The text should not be displayed.
  4. </p>
  5. </section>

The HTML5 hidden attribute can be applied on all HTML elements.

If your broswer doesn’t support HTML5 attribute, you can simply use CSS “display:none;”.

  1. *[html element] { display: none; }

So I think this is very handy attribute which will reduce the CSS hide display. it is more semantic as well efficient for both the coder and users.

You can subscribe to PHPZAG.COM posts by Email

 

 

 

  1. No comments yet.
  1. No trackbacks yet.