CSS Display Property
CSS Display Property
display property
w3schools.com
THE WORLD'S LARGEST WEB DEVELOPER SITE
☰
Example
Display <p> elements as inline elements:
p.inline {
display: inline;
}
Try it Yourself »
More "Try it Yourself" examples below.
Default value: inline
Inherited: no
Animatable: no. Read about animatable
Version: CSS1
Browser Support
http://www.w3schools.com/cssref/pr_class_display.asp 1/4
29/06/2016 CSS display property
The numbers in the table specify the first browser version that fully supports the property.
Property
Note: The values "inlinetable", "table", "tablecaption", "tablecell", "tablecolumn",
"tablecolumngroup", "tablerow", and "tablerowgroup" are not supported in IE7 and
earlier. IE8 requires a !DOCTYPE. IE9 supports the values.
Note: The values "flex" and "inlineflex" requires a prefix to work in Safari. For "flex" use
"display: webkitflex", for "inlineflex" use "display: webkitinlineflex;".
CSS Syntax
display: value;
Property Values
flex Displays an element as an blocklevel flex container.
New in CSS3
inlineblock Displays an element as an inlinelevel block container.
The inside of this block is formatted as blocklevel box,
and the element itself is formatted as an inlinelevel box
inlineflex Displays an element as an inlinelevel flex container.
New in CSS3
inlinetable The element is displayed as an inlinelevel table
runin Displays an element as either block or inline, depending
on context
http://www.w3schools.com/cssref/pr_class_display.asp 2/4
29/06/2016 CSS display property
table Let the element behave like a <table> element
tablecaption Let the element behave like a <caption> element
tablecolumn Let the element behave like a <colgroup> element
group
tableheader Let the element behave like a <thead> element
group
tablefooter Let the element behave like a <tfoot> element
group
tablerowgroup Let the element behave like a <tbody> element
tablecell Let the element behave like a <td> element
tablecolumn Let the element behave like a <col> element
tablerow Let the element behave like a <tr> element
inherit Inherits this property from its parent element. Read
about inherit
More Examples
Example
A demonstration of how to use the inherit property value:
body {
display: inline;
}
p {
display: inherit;
}
http://www.w3schools.com/cssref/pr_class_display.asp 3/4
29/06/2016 CSS display property
Try it Yourself »
Example
Set the direction of some flexible items inside a <div> element in reverse order:
div {
display: ‐webkit‐flex; /* Safari */
‐webkit‐flex‐direction: row‐reverse; /* Safari 6.1+ */
display: flex;
flex‐direction: row‐reverse;
}
Try it Yourself »
Related Pages
CSS tutorial: CSS Display and visibility
HTML DOM reference: display property
http://www.w3schools.com/cssref/pr_class_display.asp 4/4