close[x]


CSS

CSS-Home CSS-Environment CSS-Basic syntax CSS-Selector CSS-How To Add CSS CSS-Comment CSS-Color CSS-Background CSS-Font CSS-Text CSS-Boarder CSS-Margin CSS-Padding CSS-Height/Width CSS-Link CSS-Table CSS-Visibility CSS-Scrollable CSS-Float/Clear CSS-Line CSS-Align CSS-Dimension CSS-Event CSS-Pusedo class CSS-Position CSS-Transparency CSS-Dropdown CSS-Form CSS-List/Counter CSS-Website layout CSS-Text effect CSS-Image effect CSS-Button effect CSS-page number CSS-Box CSS-@media CSS-Multi device CSS-Multi device 1 CSS-Multi device 2



learncodehere.com




CSS - Visibility

The CSS visibility property is used to specify whether an element is visible or hide.

You may choose to use the visibility property to hide error messages that are only displayed if the user needs to see them, or to hide

The visibility property can take the following values −

  • visible : It is default value. It specifies that the element is visible.
  • hidden : It specifies that the element is invisible (but still takes up space).
  • collapse : It is used only for table elements. It is used to remove a row or column, but it does not affect the table layout.

  • Example : CSS - Visibility

    <!DOCTYPE html>
    <html>
    <head>
    <style>
    h3 {
    visibility: visible;
    }
    p {
    visibility: hidden;
    }
    </style>
    </head>
    <body>

    <p>code always.</p>
    <h3>Code Always To Become Best Programmer.</h3>
    <h4 style = "visibility:hidden;" >code now.</h4>

    </body>
    </html>

    When the above code is compiled , it produces the following result.

    Result

    Code Always To Become Best Programmer.