Display property in CSS defines how the components(div, hyperlink, heading etc) are going to be placed on the web page. As the name suggests, this property is used to define the display of the different parts of a web page.
There are mainly four types of display properties which are given below:
Block: This property is used as the default property of div. This property places the div one after another vertically. Height and width of the div can be changed using the block property if the width is not mentioned, then div under block property will take up the width of the container.
Inline: This property is the default property of anchor tags. This is used to place the div inline i.e. in a horizontal manner. The inline display property ignores the height and the width set by the user.
Inline-block: This features uses the both properties mentioned above, block and inline. So, this property aligns the div inline but the difference is it can edit the height and the width of block. Basically, this will align the div both in block and inline fashion.
None: This property hides the div or the container which use this property. Using it on one of the div it will make working clear.
- HTML | DOM Style display Property
- Display Property in Bootstrap with Examples
- Hide or show elements in HTML using display property
- What is the difference between display: inline and display: inline-block in CSS?
- How Facebook Display Ads for something you searched
- How to display HTML tags as plain text using PHP
- CSS | transition-property Property
- CSS | top Property
- CSS | right Property
- CSS | all Property
- CSS | grid-row-end Property
- CSS | order property
- CSS | grid-gap Property
- CSS | animation-name Property
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.