textShadow style property
3.5 | ||||
Specifies or returns a comma-separated list of shadow effects to be applied to the text of the element.
Note: The textShadow property is supported in Firefox from version 3.5.
Syntax:
You can find the related objects in the Supported by objects section below.
This property is read/write.
CSS page for this property: text-shadow |
Possible values:
The type of this property is string.
One of the following values: | ||||||||||||||||||||||||
|
Description of values:
The blur radius of the shadow in length units, 0 value means sharp, larger values mean the shadow is blurred. For the supported length units, see the length page. | |||||||
The color of the shadow, if not specified, the value of the color property is used. For the supported color values, see the colors page. | |||||||
The horizontal offset of the shadow from the text in length units. For the supported length units, see the length page. | |||||||
Takes the value of this property from the computed style of the parent element. | |||||||
Default. No shadow is drawn. | |||||||
The vertical offset of the shadow from the text in length units. For the supported length units, see the length page. |
Default: none.
Example HTML code 1:
This example illustrates the use of the text-shadow property:
|
||||
<head> <style> .example { text-shadow: green 4px 4px, blue -4px -4px; } </style> </head> <body> <p class="example">text shadow</p> </body> |
||||
|
||||
Did you find this example helpful?
|
Example HTML code 2:
This example illustrates the use of the textShadow property in JavaScript:
|
||||
<head> <style> .example { text-shadow: green 4px 4px, blue -4px -4px; } .example2 { text-shadow: red 4px 4px; } </style> <script type="text/javascript"> function ChangeShadow (elem) { elem.className = "example2"; // Solve Opera refresh problems if (window.opera) { var next = elem.nextSibling; var par = elem.parentElement; par.removeChild (elem); par.insertBefore (elem, next); } } </script> </head> <body> <p class="example" onclick="ChangeShadow (this);">Click to change!</p> </body> |
||||
|
||||
Did you find this example helpful?
|
Supported by objects:
CSSStyleDeclaration, htmlElement.currentStyle, htmlElement.style
HTML elements:
a, abbr, acronym, address, b, bdo, big, blink, blockquote, body, button, caption, center, cite, code, col, colgroup, 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, plaintext, 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:
color
font
fontFamily
fontSize
fontSizeAdjust
fontStyle
fontVariant
fontWeight
textAlign
textAlignLast
textAutospace
textDecoration
textIndent
textJustify
textKashidaSpace
textOverflow
textTransform
textUnderlinePosition
font
fontFamily
fontSize
fontSizeAdjust
fontStyle
fontVariant
fontWeight
textAlign
textAlignLast
textAutospace
textDecoration
textIndent
textJustify
textKashidaSpace
textOverflow
textTransform
textUnderlinePosition
External links:
User Contributed Comments