• Tutorials Logic, IN
  • +91 8092939553
  • info@tutorialslogic.com

CSS Display and Visibility

Display

The display property in CSS is the most important and commonly used property, which is used to control the layout of an element. It defines how the element is shown, or whether to show or hide them. There are various types of the display property value available in CSS, which are given below-

ValueDescription
inlineIt is used to display the HTML element as an inline element.
inline-blockIt is used to display the HTML element as an inline-level block container.
blockIt is used to display the HTML element as a block element.
run-inIt is used to display the HTML element as an inline or block level, depending on context.
noneIt is used to remove the HTML element from the web page.
										    
											span {
												display: block;
											}
											
										

Visibility

The visibility property in CSS determines whether an element should be visible or not in the HTML document. There are various types of the visibility property value available in CSS, which are given below-

ValueDescription
ValueDescription
visible It is the default value. The HTML element box and its contents are visible normally in the web document.
hiddenThe HTML element box and its contents are invisible, but still takes up the space in the HTML document.
collapseIt is only used for the table elements. It is used to remove the rows and column from the table without affecting the layout of the table and their space is available for other content.
inheritIt defines the value of the visibility property should be inherited from its parent element.
										    
											h1 {
												visibility: hidden;
											}