You are here: Reference > JavaScript > client-side > style handling > properties > browser specific extensions > webkitTextFillColor

webkitTextFillColor style property

Browser support:
Specifies or retrieves the fill color of the text.
The color property also affects the fill color, but the webkitTextFillColor has higher precedence.

Syntax:

object.webkitTextFillColor;
You can find the related objects in the Supported by objects section below.
This property is read/write.
CSS page for this property: -webkit-text-fill-color

Possible values:

The type of this property is string.
 One of the following values: 
color
Color of the text. For the supported color values, see the colors page.
inherit
Takes the value of this property from the computed style of the parent element.
Default: black.

Example HTML code 1:

This example illustrates the use of the -webkit-text-fill-color property:
<head>
    <style>
        #myDiv { 
            -webkit-text-fill-color: red;
        }
    </style>
</head>
<body>
    <div id="myDiv">
        Some text content in the division
    </div>
</body>
Did you find this example helpful? yes no

Example HTML code 2:

This example illustrates the use of the webkitTextFillColor property in JavaScript:
<head>
    <style>
        #myDiv { 
            -webkit-text-fill-color: red;
        }
    </style>
    <script type="text/javascript">
        function ChangeToGreen () {
            var div = document.getElementById ("myDiv");

            if ('webkitTextFillColor' in div.style) {
                div.style.webkitTextFillColor = "green";
            } else {
                alert ("Your browser doesn't support this example!");
            }
        }
    </script>
</head>
<body>
    <div id="myDiv">
        Some text content in the division
    </div>
    <button onclick="ChangeToGreen ();">Change Text to green</button>
</body>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content