HOME

CSS Basic
CSS HOME
CSS Introduction
CSS Syntax
CSS How To
CSS Background
CSS Text
CSS Font
CSS Border
CSS Margin
CSS Padding
CSS List

CSS Advanced
CSS Dimension
CSS Classification
CSS Positioning
CSS Pseudo-class
CSS Pseudo-element
CSS Media Types

Examples/Quiz
CSS Examples
CSS Quiz Test

References
CSS2 Reference
CSS2 Print
CSS2 Aural
CSS Units
CSS Colors
CSS Colorvalues
CSS Colornames

Please visit our sponsors !

The display property

Back

The display property sets how/if an element is displayed.

Inherited: No

Example

p
{
display: block
}

li
{
display: list-item
}

table
{
display: table
}

td, th
{
display: table-cell
}

Possible Values

Value Description NN IE
none The element will not be displayed 4.0 4.0
block The element will be displayed as a block-level element, with a line break before and after the element 4.0 5.0
inline The element will be displayed as an inline element, with no line break before or after the element   5.0
list-item The element will be displayed as a list 4.0  
run-in The element will be displayed as block-level or inline element depending on context    
compact The element will be displayed as block-level or inline element depending on context    
marker      
table The element will be displayed as a block table (like <table>), with a line break before and after the table    
inline-table The element will be displayed as an inline table (like <table>), with no line break before or after the table    
table-row-group The element will be displayed as a group of one or more rows (like <tbody>)    
table-header-group The element will be displayed as a group of one or more rows (like <thead>)   5.0
table-footer-group The element will be displayed as a group of one or more rows (like <tfoot>)   5.0
table-row The element will be displayed as a table row (like <tr>)    
table-column-group The element will be displayed as a group of one or more columns (like <colgroup>)    
table-column The element will be displayed as a column of cells (like <col>)    
table-cell The element will be displayed as a table cell (like <td> and <th>)    
table-caption The element will be displayed as a table caption (like <caption>)    

Browser Notes

Notes in IE 4.0:

  • "display: none" on block elements take up place (insert a linefeed)

Notes in IE 5.0:

  • "display: inline" does not work properly on lists and list items

Notes in Netscape 4.x:

  • "display: block" on inline elements, input fields, and images insert a linefeed before
  • "display: inline" on block elements insert a linefeed after
  • "display: inline" does not work properly on list items and definition lists
  • "display: list-item" places a line-break before and after the element
  • "display: list-item" on ordered lists make it behave like unordered lists
  • "display: list-item" on list items insert a line-break before the content of the list item
  • "display: list-item" on a table header and table data indents the content within the cell
  • "display: none" on block elements take up place (insert a linefeed)
  • "display: none" does not work on definition lists and selection lists


Back

Jump to: Top of Page or HOME or Printer Friendly Printer friendly page


Search W3Schools:


What Others Say About Us

Does the world know about us? Check out these places:

Dogpile Alta Vista MSN Google Excite Lycos Yahoo Ask Jeeves


We Help You For Free. You Can Help Us!


W3Schools is for training only. We do not warrant its correctness or its fitness for use. The risk of using it remains entirely with the user. While using this site, you agree to have read and accepted our terms of use and privacy policy.

Copyright 1999-2002 by Refsnes Data. All Rights Reserved


Validate How we converted to XHTML Validate

IISProtect
Password Protect
Your Web Pages



Your own Web Site?

Read W3Schools
Hosting Tutorial



$15 Domain Name
Registration
Save $20 / year!



Advertise
at W3Schools

Only 0.5 CPM



SELECTED LINKS

University Online
Master Degree
Bachelor Degree


Web Software

The Future of
Web Development


Jobs and Careers

Web Security
Web Statistics
Web Standards


PARTNERS

W3Schools
TopXML
VisualBuilder
XMLPitstop
DevelopersDex
DevGuru
Programmers Heaven
The Code Project
Tek Tips Forum
ZVON.ORG
TopXML Search