1. <div hidden="hidden"></div>

完全隐藏了

2. <div style="display:none"></div>

完全隐藏,与上面的区别在哪儿,不大明确。有的说hidden会在使用zepto.fullpage.js的时候,使用这种方式隐藏整个.wp会出现问题。而使用hidden则不会。原因未知。

另有文章说

2. <div style="visibility: hidden"></div>

视觉隐藏,空间保留,相当于全透明了。

参考文档:

1) What is the difference between the hidden attribute (HTML5) and the display:none rule (CSS)?
http://stackoverflow.com/questions/6708247/what-is-the-difference-between-the-hidden-attribute-html5-and-the-displaynone

2) HTML5 Accessibility Chops: hidden and aria-hidden
https://www.paciellogroup.com/blog/2012/05/html5-accessibility-chops-hidden-and-aria-hidden/

标签: none 阅读量: 791

添加新评论