You are here: Reference > JavaScript > client-side > style handling > properties > browser specific extensions > webkitTextStrokeColor
webkitTextStrokeColor style property
Sets or retrieves the color of text's outline.
The color property also affects the outline color, but the webkitTextStrokeColor has higher precedence.
Syntax:
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-color |
Possible values:
The type of this property is string.
One of the following values:
Color of text's outline. For the supported color values, see the colors page. | |||||||
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-stroke-color 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?
|
Example HTML code 2:
This example illustrates the use of the webkitTextStrokeColor 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 ChangeStrokeColor () { var div = document.getElementById ("myDiv"); if ('webkitTextStrokeColor' in div.style) { div.style.webkitTextStrokeColor = "green"; } else { alert ("Your browser doesn't support this example!"); } } </script> </head> <body> <div id="myDiv"> Some stroked text </div> <button onclick="ChangeStrokeColor ();">Change stroke color to green</button> </body> |
||||
|
||||
Did you find this example helpful?
|
Supported by objects:
CSSStyleDeclaration, htmlElement.style
HTML elements:
a, abbr, acronym, address, b, bdo, big, blockquote, body, button, caption, center, cite, code, dd, del, dfn, dir, div, dl, dt, em, fieldset, font, form, h1, h2, h3, h4, h5, h6, html, i, input:button, input:file, input:password, input:reset, input:search, input:submit, input:text, ins, isindex, kbd, label, legend, li, marquee, menu, ol, p, pre, q, s, samp, select, small, span, strike, strong, sub, sup, table, tbody, td, textarea, tfoot, th, thead, tr, tt, u, ul, var, xmp
Related pages:
External links:
User Contributed Comments