W3Schools.com

CSS Reference

CSS Reference
CSS Selectors
CSS Reference Aural
CSS Web Safe Fonts
CSS Units
CSS Colors
CSS Color Values
CSS Color Names
CSS Color HEX
CSS3 Browser Support

CSS Properties

CSS display Property

CSS Reference Complete CSS Reference

Example

Display the <p> element as an inline element:

p.inline
{
display:inline;
}

Try it yourself »

Definition and Usage

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"


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

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.


Property Values

Value Description Play it
none The element will not be displayed at all Play it »
block The element is displayed as a block element (like paragraphs and headers). A block element has some whitespace above and below it and does not tolerate any HTML elements next to it Play it »
inline This is default. The element is displayed as an inline element (like span). An inline element has no line break before or after it, and it tolerates HTML elements next to it 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-table The element is displayed as an inline 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


Related Pages

CSS tutorial: CSS Display and visibility

HTML DOM reference: display property


Examples

Try it Yourself - Examples

Using the inherit value
This example demonstrates how to use the inherit property value.


CSS Reference Complete CSS Reference

14,336,250 Sites Built with Wix. Create yours today!

Click here to make a stunning website for Free.

Wix.com offers an easy-to-use online platform that enables anyone to design and publish professional, beautiful websites for free.

With total design control, eCommerce features and superior search engine results, Wix offers a complete solution for launching an exquisite website while saving tons of money.


Award-winning XML Tools: Altova MissionKit

Altova MissionKit

The Altova MissionKit is an integrated suite of tools ideal for:

  • XML development
  • Web & Web services development
  • Data mapping & integration
  • Rendering & publishing XML & database data
  • XBRL validation, taxonomy editing, transformation & rendering
  • Chart & report generation for XML & XBRL

Altova MissionKit includes XMLSpy® - the industry leading XML editor, MapForce® - a graphical, any-to-any data mapping tool, StyleVision® - a visual XSLT and report designer, and much more. You’ll get 7 tools for less than the price of 2!

Try Altova MissionKit free for 30 days!

Download a fully-functional free trial

  Altova Missionkit

Try it now!


WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
UK Reseller Hosting
Cloud Hosting
Top Web Hosting
$3.98 Unlimited Hosting
250+ Hosting Apps
WEB BUILDING
XML Editor - Free Trial!
FREE Website BUILDER
FREE Website Creator
Easy Form Builder
W3SCHOOLS EXAMS
Get Certified in:
HTML, CSS, JavaScript, jQuery, XML, PHP, ASP
W3SCHOOLS BOOKS
New Books:
HTML, CSS
JavaScript, and Ajax
STATISTICS
Browser Statistics
Browser OS
Browser Display
SHARE THIS PAGE


Original text