css display hide code example

Example 1: hidden vs visible

display:none 
/*means that the tag in question will 
not appear on the page at all 
(although you can still interact with it through the dom). 
There will be no space allocated for it between the other tags.*/

visibility:hidden 
/*means that unlike display:none, 
the tag is not visible, but space is allocated for it on the page. The tag is rendered, 
it just isn't seen on the page.*/

Example 2: hide element using css

#tinynav1
{
  display:none
}

Example 3: how to hide div in html

document.getElementById('elementName').hide();

Example 4: css hide element

.classname {
    display: none;
}

Example 5: hide in css

display:none;

Tags:

Css Example