Open In App

CSS -webkit-appearance

Last Updated : 12 Jul, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

The -webkit-appearance property is a CSS feature used to control the default styling of HTML elements, overriding the browser’s default styles (such as buttons, input fields, or scrollbars). It is specific to WebKit-based browsers like Chrome and Safari, allowing elements to adopt or ignore native OS styling.

Syntax

element{
webkit-appearance:values;
}
  • element: The HTML element you want to style (e.g., button, input, div).
  • value: A keyword that specifies the desired UI control appearance (e.g., button, checkbox, textfield).

When you set -webkit-appearance: none; the element removes the browser’s default styling, allowing you to fully customize its look using other CSS properties.

For example, let's say you want to style a <button> and remove its default appearance, making it easier to apply custom styles:

CSS
button {
    -webkit-appearance: none;
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
}

This will remove the default browser styling for the button and allow you to fully customize its appearance.

Example 1: In this example we applies the appearance: button; style to the <h2> tag, making it look like a button across various browsers. The page also includes a real <button> element.

HTML
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" 
          content="width=device-width,initial-scale=1">
    <style>
        h2 {
            /* WebKit */
            -webkit-appearance: button !important;
            /* Mozilla */
            -moz-appearance: button;
            /* Opera */
            -o-appearance: button;
            /* Internet Explorer */
            -ms-appearance: button;
            /* CSS3 */
            appearance: button;
            width: 400px;
            padding: 1em;
            color: #f00;
        }
    </style>
</head>

<body>
    <center>
        <h1 style="color:green; padding:13px;">
            GeeksforGeeks
        </h1>

        <p>Webkit-Appearance Button of HTML H2 tag</p>

        <br>
        <h2>Welcome to GeeksforGeeks</h2>

        <p>HTML Button tag</p>

        <br>
        <br>
        <button>Welcome to GeeksforGeeks</button>
    </center>
</body>
</html>

Output:

Example 2: In this example we styles an <input type="range"> element to appear as a vertical slider using the appearance: slider-vertical; property. It demonstrates the effect alongside a normal horizontal range input.

HTML
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" 
          content="width=device-width,initial-scale=1">
    <style>
        #webkit {
            /* WebKit */
            -webkit-appearance: slider-vertical !important;
            /* Mozilla */
            -moz-appearance: slider-vertical;
            /* Opera */
            -o-appearance: slider-vertical;
            /* Internet Explorer */
            -ms-appearance: slider-vertical;
            /* CSS3 */
            appearance: slider-vertical;
        }
    </style>
</head>

<body>
    <center>
        <h1 style="color:green; padding:13px;">
            GeeksforGeeks
        </h1>

        <p>
            Webkit-Appearance slider-vertical of HTML
            input[type=range] tag
        </p>

        <br>
        <br>
        <input id="webkit" type="range" min="0" max="10" />
        <br>
        <br>

        <p>Normal HTML input[type=range] tag</p>

        <br>
        <br>
        <input type="range" min="0" max="10" />
    </center>
</body>

</html>

Output:

Common Use Cases for -webkit-appearance

  • Buttons: The -webkit-appearance property is most commonly used to style buttons. By default, different browsers have their own button styles, but using -webkit-appearance: none; allows you to design your buttons without any interference from the browser's native styles.
  • Input Fields: If you’re looking to remove the default styling from form input fields, such as text inputs, checkboxes, or radio buttons, -webkit-appearance: none; can help.
  • Select Dropdowns: Dropdown menus often have native styles applied by browsers, such as arrows and borders. Using -webkit-appearance: none; allows you to create a cleaner, more customized look for dropdown menus.
  • Checkboxes and Radio Buttons: Native checkboxes and radio buttons also inherit platform-specific styles, but you can modify their appearance by using the -webkit-appearance property. This makes it easier to create a consistent design for these elements across different browsers.

Similar Reads