Comparison of layout engines (Cascading Style Sheets)
The following tables compare CSS compatibility and support for a number of layout engines. Please see the individual products' articles for further information. This article is not all-inclusive or necessarily up-to-date. Unless otherwise specified in footnotes, comparisons are based on the stable versions without any add-ons, extensions or external programs.
__TOC__
CSS version support
See the article Cascading Style Sheets for more information on the different versions of CSS. This table doesn't reference CSS2.0, as CSS2.1 was intended to replace it by correcting or removing a few errors and features rejected by the CSS community. Most of the removed CSS2 features will be made obsolete by CSS3.
Trident |
Tasman |
Gecko |
WebKit |
KHTML |
Presto |
iCab |
Prince XML |
|
|---|---|---|---|---|---|---|---|---|
CSS1 |
||||||||
CSS2.1 |
||||||||
CSS3 |
Grammar and rules
Trident |
Tasman |
Gecko |
WebKit |
KHTML |
Presto |
|||
|---|---|---|---|---|---|---|---|---|
CSS2 |
|
Weight increasing |
||||||
|
Comments |
|||||||
|
Import stylesheet |
|||||||
|
Character set |
? |
||||||
|
Media-specific rules |
|||||||
|
For paged media |
|||||||
CSS3 |
|
Namespace declaration |
||||||
|
Define font |
|||||||
Trident grammar and rule notes
!important— !important doesn't override rules defined later in the same declaration block prior to IE7.@import— Media type support is broken in all versions including IE7. For@import exampleurl examplemedia;IE requests the urlexampleurl%20examplemediaand will include url() and/or quotes in the url, too, if present in the @import rule.@font-face— Only supports Embedded OpenType (.eot) font format, does not understand theformat()identifier.
Tasman grammar and rule notes
@font-face— Versions 5.16 and 5.17 will download fonts specified but not use them. 5.23 no longer downloads the font.
Presto grammar and rule notes
@import— Whilst Gecko, WebKit and iCab download all media stylesheets immediately, Opera only downloads handheld, print, projection and screen media, as well as speech if "voice" feature is enabled and tv, on tv devices. Text browser emulation mode is only a user stylesheet, so it does not switch to tty media type. This is consistent with older text browsers, which do not respect any CSS.
Selectors
Trident |
Tasman |
Gecko |
WebKit |
KHTML |
Presto |
|||
|---|---|---|---|---|---|---|---|---|
Element selectors |
||||||||
CSS2 |
|
Universal |
||||||
|
Element |
|||||||
|
Class |
|||||||
|
ID |
|||||||
CSS3 |
|
Namespaced |
||||||
Relationship selectors |
||||||||
CSS2 |
|
Descendant |
||||||
|
Child |
|||||||
|
Direct adjacent |
|||||||
CSS3 |
|
Indirect adjacent |
||||||
Attribute selectors |
||||||||
CSS2 |
|
Has |
||||||
|
Equals |
|||||||
|
Contains (space-separated) |
|||||||
|
Contains (hyphen-separated) |
|||||||
CSS3 |
|
Begins with |
||||||
|
Ends with |
|||||||
|
Contains substring |
|||||||
|
Namespaced |
|||||||
Pseudo-classes |
||||||||
CSS2 |
|
Unvisited hyperlink |
||||||
|
Visited hyperlink |
|||||||
|
Active |
|||||||
|
Mouseover |
|||||||
|
Focused |
|||||||
|
First child |
|||||||
|
Language |
|||||||
CSS3 |
|
Root |
||||||
|
First child of type |
|||||||
|
Last child |
|||||||
|
Last child of type |
|||||||
|
Only child |
|||||||
|
Only child of type |
|||||||
|
Nth child |
|||||||
|
Nth last child |
|||||||
|
Nth child of type |
|||||||
|
Nth last child of type |
|||||||
|
Target |
|||||||
|
Empty |
|||||||
|
Negation |
|||||||
|
Enabled state |
|||||||
|
Disabled state |
|||||||
|
Checked state |
|||||||
|
Indeterminate state |
|||||||
|
Default |
|||||||
|
Valid |
|||||||
|
Invalid |
|||||||
|
In range |
|||||||
|
Out of range |
|||||||
|
Required |
|||||||
|
Optional |
|||||||
|
Read-only |
|||||||
|
Read and write |
|||||||
Pseudo-elements |
||||||||
CSS2 |
|
First letter |
||||||
|
First line |
|||||||
|
Before |
|||||||
|
After |
|||||||
CSS3 |
|
Double colon notation |
||||||
|
Double colon notation |
|||||||
|
Double colon notation |
|||||||
|
Double colon notation |
|||||||
|
Selection |
|||||||
|
Trident |
Tasman |
Gecko |
WebKit |
KHTML |
Presto |
||
Trident selector notes
:active—:activeis for anchor element only.:hover—:hoveris applied for all elements only in standards-compliant mode, not quirks mode 2. Prior to 7.0,:hoveris for anchor element only..one.two— only.twoclass selector was taken into consideration before 7.0.*— Prior to 7.0 this was treated as a single or no element.:first-letter— float and vertical-align properties not allowed.:first-line— can't be attached to a inline-block element and background property doesn't work when pseudo-element is attached to a layout element.[attr]— matches every td and th in a table when the attribute is colspan (regardless of whether any actually have a colspan attribute). See Bug 446817.
Tasman selector notes
:hover— For anchor element only prior to 0.9..one.two— only.twoclass selector is taken into consideration.
Gecko selector notes
:*-of-type— See Bug 128585 on Bugzilla.:nth-*— See Bug 75375 on Bugzilla.(:):before, (:):after— CSS2.0 behavior : some properties are unimplemented prior to 1.9.1. See Bug 237119 on Bugzilla.
WebKit selector notes
:lang()— Only detected when explicitly present on element being tested, attribute not inherited.:first-line—text-transformdoesn't apply with this pseudo-element. See Bug 3409 on Bugzilla.
Presto selector notes
:target— Style doesn't get applied when navigating using back and forward buttons.
Properties
Trident |
Tasman |
Gecko |
WebKit |
KHTML |
Presto |
iCab |
||
|---|---|---|---|---|---|---|---|---|
Box Model |
||||||||
CSS2 |
|
|||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
CSS3 |
|
|||||||
|
||||||||
Borders |
||||||||
CSS2 |
|
|||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
CSS3 |
|
|||||||
|
||||||||
|
||||||||
|
||||||||
Line Layout |
||||||||
CSS2 |
|
|||||||
|
||||||||
Positioning |
||||||||
CSS2 |
|
|||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
Generated and Replaced Content |
||||||||
CSS2 |
|
|||||||
|
||||||||
|
||||||||
|
||||||||
Lists |
||||||||
CSS2 |
|
|||||||
|
||||||||
|
||||||||
|
||||||||
Colors |
||||||||
CSS2 |
|
|||||||
CSS3 |
|
|||||||
Backgrounds |
||||||||
CSS2 |
|
|||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
CSS3 |
|
|||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
Fonts |
||||||||
CSS2 |
|
|||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
CSS3 |
|
|||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
Text |
||||||||
CSS2 |
|
|||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
CSS3 |
|
|||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
Tables |
||||||||
CSS2 |
|
|||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
User interface |
||||||||
CSS2 |
|
|||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
CSS3 |
|
|||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
Paged media |
||||||||
CSS2 |
|
|||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
CSS3 |
|
|||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
Speech |
||||||||
CSS3 |
|
rowspan="22" |
rowspan="22" |
rowspan="22" |
rowspan="22" |
rowspan="22" |
rowspan="22" |
|
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
Media Queries |
||||||||
CSS3 |
|
rowspan="13" |
rowspan="13" |
rowspan="13" |
rowspan="13" |
|||
|
? |
|||||||
|
? |
|||||||
|
? |
|||||||
|
? |
? |
||||||
|
? |
? |
||||||
|
? |
|||||||
|
? |
|||||||
|
? |
|||||||
|
? |
|||||||
|
? |
|||||||
|
? |
|||||||
|
? |
|||||||
Ruby characters |
||||||||
CSS3 |
|
rowspan="4" |
rowspan="4" |
rowspan="4" |
rowspan="4" |
rowspan="4" |
||
|
||||||||
|
||||||||
|
||||||||
Multi-column Layout |
||||||||
CSS3 |
|
rowspan="7" |
rowspan="7" |
rowspan="7" |
rowspan="7" |
rowspan="7" |
||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
|
||||||||
Trident property notes
overflow—overflow:visibleis incorrectly supported prior to IE7.border-style—hiddenis not supported.dottedis rendered asdashedprior to IE7.display— Onlynone,block,inline,table-header-group, andtable-footer-groupare supported prior to 7.0. In 5.5+, inline-block is supported on elements that are naturally inline.position— Prior to IE 7, fixed positioning was not supported, IE 7 supports it in standards-compliant mode only.visibility— Prior to IE 8,collapsevalue is not supported.background-attachment— Prior to IE 7,fixedwas allowed on thebodyelement only.opacity— isn't implemented. Trident is supporting a proprietary alternative (not understood by other layout engines) since v4.0. [http://msdn2.microsoft.com/en-us/library/ms532910(VS.85).aspx]background-position— Fixed positioning is not supported.border-color—transparentvalue is not supported prior to IE7.font-weight— Incorrect rendering when value is 600 3.text-decoration— Optional propertyblinkis not supported.white-space—nowrapis supported in IE 5.5 and later.preis supported in IE 6 and later in standards-compliant mode.pre-lineandpre-wrapare not supported.list-style-type—decimal-leading-zero,lower-greek,lower-latin,upper-latin,upper-romanare not supported.
Gecko property notes
display—run-in4 is not supported.inline-table5 andinline-block6 are supported in Gecko 1.9a2+.z-index— Negatives values are badly supported prior to 1.9.quotes— Does not support nested quotes prior to 1.8 7.content—nonevalue is unsupported prior to 1.9.background-position— Gecko versions prior to 1.7 implement the CSS2 syntax, not the proposed CSS2.1 expanded syntax.font-size-adjust— Supported in Windows only prior to 1.9.font-weight— Only Regular and Bold weights get used, even if Light or Heavy/Black faces are installed.white-space—pre-lineis not supported prior to 1.9.1. Prior to 1.9,pre-wrapwas only supported experimentally as-moz-pre-wrap.visibility—collapseis not supported prior to 1.8.border-radius— border curves are circular, but the W3C specs 8 define them as elliptical. Dashed curves are not available. Short-cut definitions forborder-radiusread "tl tr br bl" instead of the W3C's "tr br bl tl". Interesting bugs: 9page-break-before; page-break-after— Only thealwaysandautovalues are supported.
WebKit property notes
box-shadow—font— The system font keywords are not supported that allow designers to tailor presentation to the user’s operating system environment.font-weight— Only Regular and Bold weights get used, even if Light or Heavy/Black faces are installed.page-break-before; page-break-after— Only thealwaysandautovalues are supported.text-decoration— Optional propertyblinkis not supported.white-space—pre-lineandpre-wrapfrom the proposed CSS2.1 draft are not supported.text-shadow— Multiple shadows are not supported.visibility—collapseis not supported prior to 522. Its implementation has the same effect ashiddenand is therefore not compliant.
KHTML property notes
overflow— Valuesscrollandautoare unsupported.page-break-before; page-break-after— Before 3.5 only thealwaysandautovalues were supported.text-decoration— Optional propertyblinkis not supported.visibility— All properties are supported, but the implementation ofcollapsehas the same effect ashiddenand is therefore not compliant.
Presto property notes
counter-increment, counter-reset— Implemented the algorithm in REC CSS2.background-position— Presto versions prior to 8.0 implement the CSS2 syntax, not the proposed CSS2.1 expanded syntax.font-weight— Incorrect rendering when value is 600 10. Renders the text in a compatibility mode for websites made for Trident.visibility—collapseis unsupported in table columns.
On rows, it has the same effect as hidden and is therefore not compliant.
cursor—cursoris ignored with dynamic pseudo-classes and custom cursors are unsupported.
iCab property notes
display—run-inis not supported.text-align—justifyis not supported.font-stretch— Simulated using letter-spacing property.font-weight— Incorrect (bold) rendering when value is 500.visibility—collapseonly partial.caption-side—topandbottomonly which would comply with the proposed CSS2.1 elimination of the values:leftandright.empty-cells— Compresses hidden rows but does not hide them completely.
Values and units
Trident |
Tasman |
Gecko |
WebKit |
KHTML |
||||
|---|---|---|---|---|---|---|---|---|
Numbers |
CSS2 |
A floating-point number |
||||||
An integer |
||||||||
CSS3 |
rowspan="3" |
rowspan="3" |
rowspan="3" |
|||||
Strings |
CSS2 |
String |
||||||
|
Unicode escapes |
|||||||
Shapes |
| CSS2 |
|
A rectangle |
|||||
Functions |
CSS2 |
|
Uniform Resource Identifier |
|||||
|
||||||||
|
Attribute identifier |
|||||||
| CSS3 |
|
|||||||
Colors |
CSS2 |
|
| 16 predefined web colors |
|||||
|
Hexadecimal notation |
|||||||
|
RGB notation |
|||||||
|
28 predefined system colors 11 |
|||||||
CSS3 |
|
{{?}} |
||||||
|
The value of the ‘color’ property. |
|||||||
|
RGBA notation |
|||||||
|
HSL notation |
|||||||
|
HSLA notation |
|||||||
|
Full transparency |
|||||||
Keywords |
CSS2 |
|
Automatically calculated |
|||||
|
Inherited from the parents |
? |
||||||
CSS3 |
|
|||||||
Units |
CSS2 |
|
Pixel |
rowspan="9" |
rowspan="9" |
rowspan="9" |
rowspan="9" |
rowspan="9" |
|
Point |
|||||||
|
Pica |
|||||||
|
Centimetre |
|||||||
|
Millimetre |
|||||||
|
inch |
|||||||
|
em |
|||||||
|
ex |
|||||||
|
Percentage |
|||||||
CSS3 |
|
Degree |
rowspan="16" |
rowspan="16" |
||||
|
Grad |
|||||||
|
Radian |
|||||||
|
Millisecond |
|||||||
|
Second |
|||||||
|
Hertz |
|||||||
|
Kilohertz |
|||||||
|
Dots per inch |
|||||||
|
Dots per centimetre |
|||||||
|
turn |
|||||||
|
Cells in the layout-grid |
|||||||
|
the font size of the root element |
|||||||
|
the viewport's width |
|||||||
|
the viewport's height |
|||||||
|
the viewport's height or width, whichever is smaller of the two |
|||||||
|
the width of the "0" (ZERO, U+0030) glyph found in the font for the font size used to render. |
|||||||
General value and unit notes
transparent—CSS1 introduced the ‘transparent’ value for the background-color property. CSS2 allowed border-color to also accept the ‘transparent’ value. The Open eBook(tm) Publication Structure 1.0.1 [OEB101] extended the ‘color’ property to also accept the ‘transparent’ keyword. CSS3 extends the color value to include the ‘transparent’ keyword to allow its use with all properties that accept a
value. This simplifies the definition of those properties in CSS3.
Trident value and unit notes
rect()— Correct syntax with commas is not supported.auto— In IE5 bug emulation mode (quirks mode) does not work formargins, except table elements.transparent— In IE6, transparency is not supported on borders (shows as solid black) and is ignored on PNG images, this is fixed in IE 7.0. Using the transparent keyword in combination with the color property will render the text as black.
Gecko value and unit notes
<ch>— Prior to version 1.9.1, uses the width of the "M" glyph instead of the width of the "0" glyph.12
Presto value and unit notes
<number>— Quantization error for values greater than 20.47 13 (not limited to em, try any non pixel units). Seems to have been fixed in Opera 9.6.transparent— CSS2.1 only, keyword is ignored when used with the outline-color, color and text-shadow properties.
General notes
Gecko general notes
-moz-— All experimental selectors, properties and values are prefixed with "-moz-", e.g.::-moz-selectioninstead of::selection14.
WebKit general notes
-webkit-— All experimental selectors, properties and values are prefixed with "-webkit-", e.g.-webkit-box-shadowinstead ofbox-shadow.
KHTML general notes
-khtml-— All experimental selectors, properties and values are prefixed with "-khtml-", e.g.-khtml-opacityinstead ofopacity.
Presto general notes
-xv-— All new selectors, properties and values introduced by CSS3 Speech Module are prefixed with "-xv-" (but not found in CSS2 aural style sheets), e.g.-xv-voice-rateinstead ofvoice-rate.
External links
- WebDevout — mostly covers Windows browsers. Extensive bug testing.
- QuirksMode — comprehensive but lacks latest versions.