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

webkitTextStrokeWidth style property

Browser support:
Sets or retrieves the width of text's outline.

Syntax:

object.webkitTextStrokeWidth;
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-stroke-width

Possible values:

The type of this property is string.
 One of the following values: 
inherit
Takes the value of this property from the computed style of the parent element.
medium
Same as 3px.
thick
Same as 5px.
thin
Same as 1px.
width in non-negative length
The width of text's outline in length units. For the supported length units, see the length page.
Default: medium.

Example HTML code 1:

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

Example HTML code 2:

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

            if ('webkitTextStrokeWidth' in div.style) {
                div.style.webkitTextStrokeWidth = input.value + "px";
            } else {
                alert ("Your browser doesn't support this example!");
            }
        }
    </script>
</head>
<body>
    <div id="myDiv">
        Some stroked text
    </div>
    <input type="text" onkeyup="ChangeStrokeWidth (this);" value="1" />
</body>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content