首页 > Web开发 > 详细

HTML 5--Controlling the Visbility of Elements

时间:2018-04-29 17:24:42      阅读:191      评论:0      收藏:0      [点我收藏+]

1.Display:none/block/inline

2.Visibility :hidden/visible

示例代码:

 1 <!DOCTYPE html>
 2 <html>
 3 <head>
 4 <style>
 5     h2{visibility:hidden;}
 6     </style>    
 7 </head>
 8 <body>
 9 <h1>Welcome to BookYourHotel website</h1>
10 <h2>This site is very user friendly.</h2>
11 <h3>You can book your hotel while sitting at home.</h3>
12 </body>
13 </html>  

 

测试结果:
技术分享图片

*隐藏 h2 后面的部分

 

HTML 5--Controlling the Visbility of Elements

原文:https://www.cnblogs.com/Catherinezhilin/p/8971330.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!