Hiding Elements

The none value hides an element and its descendent elements.

 
<!DOCTYPE HTML> 
<html> 
    <head> 
        <title>Example</title>  
    </head> 
    <body> 
        <p id="toggle"> 
            HyperText Markup Language (HTML) is the main markup language for 
            displaying web pages and other information that can be displayed 
            in a web browser(From From Wikipedia, the free encyclopedia).
        </p> 
        <p> 
            HyperText Markup Language (HTML) is the main markup language for 
            displaying web pages and other information that can be displayed 
            in a web browser(From From Wikipedia, the free encyclopedia).
        </p> 
        <p> 
            <button>Block</button> 
            <button>None</button> 
        </p> 
        <script> 
            var buttons = document.getElementsByTagName("BUTTON"); 
            for (var i = 0; i < buttons.length; i++) { 
                buttons[i].onclick = function(e) { 
                    document.getElementById("toggle").style.display= 
                        e.target.innerHTML; 
                }; 
            } 
        </script> 
    </body> 
</html>
  
Click to view the demo
Home 
  HTML CSS Book 
    CSS  

display:
  1. Block-Level Elements
  2. Inline-Level Elements
  3. inline-block
  4. Run-In Elements
  5. Hiding Elements
Related: