The following compatibility tables try to summarize the state of CSS support for HTML forms. Due to the complexity of CSS and HTML forms, these tables can't be considered a perfect reference. However, they will give you good insight into what can and can't be done, which will help you learn how to do things.
How to read the tables
Values
For each property, there are four possible values:
- YES
- There's reasonably consistent support for the property across browsers. You may still face strange side effects in certain edge cases.
- PARTIAL
- While the property works, you may frequently face strange side effects or inconsistencies. You should probably avoid these properties unless you master those side effects first.
- NO
- The property simply doesn't work or is so inconsistent that it's not reliable.
- N.A.
- The property has no meaning for this type of widget.
Rendering
For each property there are two possible renderings:
- N (Normal)
- Indicates that the property is applied as it is
- T (Tweaked)
- Indicates that the property is applied with the extra rule below:
* {
/* Turn off the native look and feel */
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
/* for Internet Explorer */
background: none;
}
Compatibility tables
Global behaviors
Some behaviors are common to many browsers at a global level:
border
, background
, border-radius
, height
- Using one of these properties can partially or fully turn off the native look & feel of widgets on some browsers. Be careful when you use them.
line-height
- This property is supported inconsistently across browsers and you should avoid it.
text-decoration
- This property is not supported by Opera on form widgets.
text-overflow
- Opera, Safari, and IE9 do not support this property on form widgets.
text-shadow
- Opera does not support
text-shadow
on form widgets and IE9 does not support it at all.
Text fields
Property |
N |
T |
Note |
CSS box model |
width |
Yes |
Yes |
|
height |
Partial[1][2] |
Yes |
- WebKit browsers (mostly on Mac OSX and iOS) use the native look & feel for the search fields. Therefore, it's required to use
-webkit-appearance:none to be able to apply this property to search fields.
- On Windows 7, Internet Explorer 9 does not apply the border unless
background:none is applied.
|
border |
Partial[1][2] |
Yes |
- WebKit browsers (mostly on Mac OSX and iOS) use the native look & feel for the search fields. Therefore, it's required to use
-webkit-appearance:none to be able to apply this property to search fields.
- On Windows 7, Internet Explorer 9 does not apply the border unless
background:none is applied.
|
margin |
Yes |
Yes |
|
padding |
Partial[1][2] |
Yes |
- WebKit browsers (mostly on Mac OSX and iOS) use the native look & feel for the search fields. Therefore, it's required to use
-webkit-appearance:none to be able to apply this property to search fields.
- On Windows 7, Internet Explorer 9 does not apply the border unless
background:none is applied.
|
Text and font |
color [1] |
Yes |
Yes |
- If the
border-color property is not set, some WebKit based browsers will apply the color property to the border as well as the font on <textarea> s.
|
font |
Yes |
Yes |
See the note about line-height |
letter-spacing |
Yes |
Yes |
|
text-align |
Yes |
Yes |
|
text-decoration |
Partial |
Partial |
See the note about Opera |
text-indent |
Partial[1] |
Partial[1] |
- IE9 supports this property only on
<textarea> s, whereas Opera only supports it on single line text fields.
|
text-overflow |
Partial |
Partial |
|
text-shadow |
Partial |
Partial |
|
text-transform |
Yes |
Yes |
|
Border and background |
background |
Partial[1] |
Yes |
- WebKit browsers (mostly on Mac OSX and iOS) use the native look & feel for the search fields. Therefore, it's required to use
-webkit-appearance:none to be able to apply this property to search fields. On Windows 7, Internet Explorer 9 does not apply the border unless background:none is applied.
|
border-radius |
Partial[1][2] |
Yes |
- WebKit browsers (mostly on Mac OSX and iOS) use the native look & feel for the search fields. Therefore, it's required to use
-webkit-appearance:none to be able to apply this property to search fields. On Windows 7, Internet Explorer 9 does not apply the border unless background:none is applied.
- On Opera the
border-radius property is applied only if an explicit border is set.
|
box-shadow |
No |
Partial[1] |
- IE9 does not support this property.
|
Number
On browsers that implement the number
widget, there is no standard way to change the style of spinners used to change the value of the field. It is worth noting that the spinners on Safari are outside the field.
Select boxes (single line)
Firefox does not provide any way to change the down arrow on the <select>
element.
Property |
N |
T |
Note |
CSS box model |
width |
Partial[1] |
Partial[1] |
- This property is okay on the
<select> element, but it cannot be the case on the <option> or <optgroup> elements.
|
height |
No |
Yes |
|
border |
Partial |
Yes |
|
margin |
Yes |
Yes |
|
padding |
No[1] |
Partial[2] |
- The property is applied, but in an inconsistent way between browsers on Mac OSX.
- The property is well applied on the
<select> element, but is inconsistently handled on <option> and <optgroup> elements.
|
Text and font |
color |
Partial[1] |
Partial[1] |
- On Mac OSX, WebKit based browsers do not support this property on native widgets and they, along with Opera, do not support it at all on
<option> and <optgroup> elements.
|
font |
Partial[1] |
Partial[1] |
- On Mac OSX, WebKit based browsers do not support this property on native widgets and they, along with Opera, do not support it at all on
<option> and <optgroup> elements.
|
letter-spacing |
Partial[1] |
Partial[1] |
- IE9 does not support this property on
<select> , <option> , and <optgroup> elements; WebKit based browsers on Mac OSX do not support this property on <option> and <optgroup> elements.
|
text-align |
No[1] |
No[1] |
- IE9 on Windows 7 and WebKit based browsers on Mac OSX do not support this property on this widget.
|
text-decoration |
Partial[1] |
Partial[1] |
- Only Firefox provides full support for this property. Opera does not support this property at all and other browsers only support it on the
<select> element.
|
text-indent |
Partial[1][2] |
Partial[1][2] |
- Most of the browsers only support this property on the
<select> element.
- IE9 does not support this property.
|
text-overflow |
No |
No |
|
text-shadow |
Partial[1][2] |
Partial[1][2] |
- Most of the browsers only support this property on the
<select> element.
- IE9 does not support this property.
|
text-transform |
Partial[1] |
Partial[1] |
- Most of the browsers only support this property on the
<select> element.
|
Border and background |
background |
Partial[1] |
Partial[1] |
- Most of the browsers only support this property on the
<select> element.
|
border-radius |
Partial[1] |
Partial[1] |
box-shadow |
No |
Partial[1] |
Select boxes (multiline)
Datalist
File picker
Date pickers
Many properies are supported but there is to much inconstency between browsers to be reliable.
Color pickers
There is currently not enough implementation to get reliable behaviors.
Meters and progress
There is currently not enough implementation to get reliable behaviors.
Range
There is no standard way to change the style of the range grip and Opera has no way to tweak the default rendering of the range widget.
In this module