Do you want to be a good Web Developer?

Enter Your Email To Get Our Exclusive Tutorials Right In Your Email

CSS Display and Visibility

CSS Display and Visibility

CSS Display property is used to specify how element is displayed.And CSS Visibility is used to show or hide an element

Example of Display


Display Values

  • display:inline; is used to make elements displayed in a single line

  • display:block; is used to make elements displayed one in a line that is it takes full width available

  • display:none; is used to hide the elements and it will not take any spaces.

Example of Visibility


Visibility Values

  • visibility:hidden; is used to hide elements but it will take same spaces as before.

  • visibility:visible; is used to show the elements

  • visibility:collapse; is used only with dynamic table columns and row effects.

Block Elements

  • <h1>
  • <p>
  • <li>
  • <div>

  • Inline Elements

  • <span>
  • <a>
  • PrevNext

    Join Us With Our 21000+ Subscribers And Get Our Latest Tutorials Update Via Email