HTML 5--Controlling the Visbility of Elements

1.Display:none/block/inline

2.Visibility :hidden/visible

Sample code:

 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>  

 

Test Results:

* hide the part after h2

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325046561&siteId=291194637