{"id":13911,"date":"2011-08-31T19:35:29","date_gmt":"2011-09-01T02:35:29","guid":{"rendered":"http:\/\/css-tricks.com\/?page_id=13911"},"modified":"2020-11-20T14:47:05","modified_gmt":"2020-11-20T22:47:05","slug":"appearance","status":"publish","type":"page","link":"https:\/\/css-tricks.com\/almanac\/properties\/a\/appearance\/","title":{"rendered":"appearance"},"content":{"rendered":"\n

The appearance<\/code> property is used to display an element using a platform-native styling based on the users’ operating system’s theme.<\/p>\n\n\n\n

.thing {\n   -webkit-appearance: value;\n   -moz-appearance:    value;\n   appearance:         value;\n}<\/code><\/pre>\n\n\n\n

This is starting to be unprefixed<\/a>, which is great because the cross-browser story here is very complicated. <\/p>\n\n\n\n

The appearance<\/code> property is used for one of two reasons:<\/p>\n\n\n\n

  1. To apply platform-specific styling to an element that doesn’t have it by default<\/li>
  2. To remove platform-specific styling to an element that does have it by default<\/li><\/ol>\n\n\n\n

    For instance, inputs with a type=search<\/code> in WebKit browsers by default have rounded corners and are very strict in what you can alter via CSS<\/a>. If you don’t want that styling, you can remove it in one fell swoop with appearance.<\/p>\n\n\n\n

    input[type=search] {\n  -webkit-appearance: none;\n}<\/code><\/pre>\n\n\n\n

    Or you could take a input with type=text and just make it look like a search input:<\/p>\n\n\n\n

    input[type=text] {\n  -webkit-appearance: searchfield;\n}<\/code><\/pre>\n\n\n\n