html - what is the difference between "#msg" and "#msg div" in style tag? -
<html> <head> <style> #msg { visibility: hidden; position: absolute; left: 0px; top: 0px; width:100%; height:100%; text-align:center; } #msg div { width:33.3%; margin: 100px auto; background-color:#0cf; border:#000; padding:thick; text-align:center; width:15%; size:50; } </style> </head> <body> <div id="msg"><div>hello</div><a href="#" onclick="display()">close</a></div> <a href="#" onclick="display()">click me</a> </body> <script> function display(){ temp=document.getelementbyid("msg"); temp.style.visibility=(temp.style.visibility=="visible")?"hidden":"visible"; } </script> </html>
this code found in internet. made changes. can explain me why using 2 div tag ?(one within another) , difference between "#msg" , "#msg div"?
#msg
div has id name msg
#msg div
divs nowadays within #msg
div.
html css
No comments:
Post a Comment