Definition and Usage
The appearance property controls the default appearance of browser UI elements, such as buttons and input fields.
Browser UI elements are elements provided by browsers that allow users to interact with a web page.
<input>, <textarea>, <select>, and <button> are common examples of Browser UI elements that allow users to enter or select data, or click the elements themselves. These elements have a default (native) appearance provided by each browser.
Default Appearance of Browser UI Elements (Buttons, Input Fields, etc.)
HTML UI elements have a default appearance provided by each browser. This default appearance is called the "native appearance." The native appearance may vary slightly from browser to browser, and some UI elements have a look and feel that cannot be fully recreated with CSS alone, such as a checkbox (<input type="checkbox">) in its checked state.
The appearance property is a CSS property that allows you to replace this default appearance with custom styles.
In particular, using appearance: none removes the default appearance, allowing you to freely apply custom styles with CSS.
Basic Example
<p>The browser's default appearance for the select tag</p>
<select>
<option>option</option>
<option>option</option>
</select>
<hr>
<p>Using appearance: none removes the default appearance of the browser UI element.</p>
<select style="appearance: none;">
<option>option</option>
<option>option</option>
</select>
The browser's default appearance for the select tag
Using appearance: none removes the default appearance of the browser UI element.
Be Careful!
Even when you use appearance: none, browsers may still render the element slightly differently, although the differences are subtle. If you use this property on a website, you should test it carefully. To reduce these styling differences, you should add custom styles with CSS.
Formal Syntax
selector {
appearance: none || auto || base-select || <compat-special> || <compat-auto>
}
Formal Definition
| Initial value | none
However, the values defined in the browser's built-in default stylesheet (user agent stylesheet) are as follows:
|
|---|---|
| Applies to | all elements |
| Inherited | no |
| Animatable | no |
Values
none |
|
|---|---|
auto |
|
base-select |
This value applies only to the <select> element and the ::picker(select) pseudo-element. For all other elements, it is rendered as auto.
Some major browsers, including Safari (including iOS browsers) and Firefox, may not support this value. Check browser compatibility before using it. |
<compat-special> |
This value exists for compatibility with content developed for earlier non-standard versions of this property. In the standardized version, this value is either menulist-button or textfield.
Although these values are supported by some browsers, they should not be used as non-standard values in the standardized specification. Browsers may discontinue support for them at any time. Both values are equivalent to auto in the standardized specification. |
<compat-auto> |
These values were introduced in earlier non-standard versions of this property. They are as follows:
All these values are equivalent to auto in the standardized specification. |
Syntax
/* Keyword values */
appearance: none;
appearance: auto;
appearance: base-select;
appearance: menulist-button;
appearance: textfield;
/* Global values */
appearance: inherit;
appearance: initial;
appearance: revert;
appearance: revert-layer;
appearance: unset;
Custom Styling Example
The following example shows how to apply custom styles to a radio button (<input type="radio">) using appearance: none:
<input type="radio" name="radio-test"> <!-- Unchecked radio button -->
<input type="radio" name="radio-test" checked> <!-- Checked radio button -->
[type="radio"] {
appearance: none;
border-radius: 50%;
box-sizing: border-box;
width: 20px;
height: 20px;
border: 1px solid gray;
cursor: pointer;
}
[type="radio"]:checked {
border: 5px solid yellowgreen;
}
Browser Compatibility
| Property |
Desktop Chrome
|
Desktop Edge
|
Desktop Firefox
|
Safari
|
|---|---|---|---|---|
appearance
|
84
1 -webkit- |
84
12 -webkit- |
80 | 15.4
3 -webkit- |
Specifications
| Specification | |
|---|---|
appearance
|
CSS Basic User Interface Module Level 4 #appearance-switching |