Display the <p> element as an inline element:
The display property defines how a certain HTML element should be displayed.
| Default value: | inline |
|---|---|
| Inherited: | no |
| Version: | CSS1 |
| JavaScript syntax: | object.style.display="inline" |
![]()
The display property is supported in all major browsers.
Note: The values "inline-table", "table", "table-caption", "table-cell", "table-column", "table-column-group", "table-row", "table-row-group", and "inherit" are not supported in IE7 and earlier. IE8 requires a !DOCTYPE. IE9 supports the values.
| Value | Description | Play it |
|---|---|---|
| none | The element will not be displayed at all | Play it » |
| box (or flex-box) | The element is displayed as a block-level flex container box | |
| block | The element is displayed as a block-level element (like paragraphs and headers) | Play it » |
| flex | The element is displayed as a block-level flex container box | |
| inline | This is default. The element is displayed as an inline-level element (like span) | Play it » |
| inline-block | The element is placed as an inline element (on the same line as adjacent content), but it behaves as a block element | |
| inline-flex | The element is displayed as an inline-level flex container box | |
| inline-table | The element is displayed as an inline-level table | |
| list-item | The element is displayed as a list-item, which means that it has a bullet in front of it | Play it » |
| table | The element is displayed as a table | |
| table-caption | The element is displayed as a table caption | |
| table-cell | The element is displayed as a table cell | |
| table-column | The element is displayed as a table column | |
| table-column-group | The element is displayed as a table column group (like <colgroup>) | |
| table-footer-group | The element is displayed as a table footer row group | |
| table-header-group | The element is displayed as a table header row group | |
| table-row | The element is displayed as a table row | |
| table-row-group | The element is displayed as a table row group | |
| inherit | The value of the display property will be inherited from the parent element |
CSS tutorial: CSS Display and visibility
HTML DOM reference: display property
Using the inherit value
This example demonstrates how to use the inherit property value.
Your message has been sent to W3Schools.