Html style="visibility:hidden"与style="display:none"的区别

  style="visibility:hidden": 使对象在网页上隐藏,但该对象在网页上所占的空间没有改变.
  style="display:none": 使对象在网页上彻底消失,不为被隐藏的对象保留物理空间.

  实际举例如下:

 1 <html>
 2   <head>
 3   <title>style="visibility:hidden"与style="display:none"的区别</title>
 4   </head>
 5  
 6   <body>
 7     <span style="visibility:hidden; background-color:Blue">隐藏区域</span><span style="background-color:Green">显示区域</span>
 8     <span style="display:none; background-color:Blue">隐藏区域</span><span style="background-color:Green">显示区域</span><br/>
 9   </body>
10 </html>

 

转:http://blog.csdn.net/maxracer/article/details/6711586

posted @ 2017-03-17 10:46  myles007  阅读(365)  评论(0编辑  收藏  举报