Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://www.arcetri.astro.it/irlab/doc/library/javascript/clientreference/style.htm
Дата изменения: Thu Oct 7 13:13:34 1999 Дата индексирования: Sat Dec 22 14:18:31 2007 Кодировка: Поисковые слова: solar corona |
document
object:
Style
object lets you implement dynamic HTML style sheets in JavaScript. The methods and properties of the Style object implement the cascading style sheet style properties of HTML in JavaScript.
For a complete description of style sheets, see Dynamic HTML in Netscape Communicator.
Method |
Description
|
|
| |
---|
watch
and unwatch
methods from Object
.
styleObject.align = {left | right | none}
styleObject |
align
with textAlign
, which specifies the alignment of the content of text elements.
The align
property is a reflection of the cascading style sheet float
property.
styleObject.backgroundColor = colorValue
styleObject | |
colorValue | A string evaluating to a color value, as described in Appendix B, "Color Values." |
backgroundColor
property is a reflection of the cascading style sheet background-color
property.
styleObject.backgroundImage = url
styleObject | |
url | A string evaluating to either a full URL or a partial URL relative to the source of the style sheet. |
backgroundImage
property is a reflection of the cascading style sheet background-image
property.
styleObject.borderBottomWidth = length
styleObject | |
length |
A string evaluating to a size followed by a unit of measurement; for example, |
borderBottomWidth
property is a reflection of the cascading style sheet border-bottom-width
property.
Style.borderLeftWidth
, Style.borderRightWidth
, Style.borderTopWidth
, Style.borderWidths
styleObject.borderColor = {none | colorValue}
styleObject | |
colorValue | A string evaluating to a color value, as described in Appendix B, "Color Values." |
borderColor
property is a reflection of the cascading style sheet border-color
property.
styleObject.borderLeftWidth = length
styleObject | |
length |
A string evaluating to a size followed by a unit of measurement; for example, |
borderLeftWidth
property is a reflection of the cascading style sheet border-left-width
property.
Style.borderBottomWidth
, Style.borderRightWidth
, Style.borderTopWidth
, Style.borderWidths
styleObject.borderRightWidth = length
styleObject | |
length |
A string evaluating to a size followed by a unit of measurement; for example, |
borderRightWidth
property is a reflection of the cascading style sheet border-right-width
property.
Style.borderBottomWidth
, Style.borderLeftWidth
, Style.borderTopWidth
, Style.borderWidths
styleObject.borderStyle = styleType
styleObject | |
styleType |
borderStyle
property is a reflection of the cascading style sheet border-style
property.
styleObject.borderTopWidth = length
styleObject | |
length |
A string evaluating to a size followed by a unit of measurement; for example, |
borderTopWidth
property is a reflection of the cascading style sheet border-top-width
property.
Style.borderBottomWidth
, Style.borderLeftWidth
, Style.borderRightWidth
, Style.borderWidths
borderWidths(top, right, bottom, left)
borderWidths
method is a convenience shortcut for setting all the border width properties.
Style.borderBottomWidth
, Style.borderLeftWidth
, Style.borderRightWidth
, Style.borderTopWidth
styleObject.clear = {left | right | both | none}
styleObject |
clear
property is a reflection of the cascading style sheet clear
property.
styleObject.color = colorValue
styleObject | |
colorValue | A string evaluating to a color value, as described in Appendix B, "Color Values." |
color
property is a reflection of the cascading style color
property.
styleObject.display = styleType
styleObject | |
styleType |
display
property is a reflection of the cascading style display
property.
styleObject.fontFamily = {specificFamily | genericFamily}
styleObject | |
specificFamily |
A string evaluating to a comma-separated list of specific font families, such as |
genericFamily |
fontFamily
property is a reflection of the cascading style sheet font-family
property. The genericFamily keywords are available for all platforms, but the specific font displayed varies on each platform.
You can mix the specificFamily and genericFamily keywords in the same value. For example, the following code displays text in Helvetica if that font is available; otherwise, the text displays in a sans-serif font determined by the operating system:
document.tags.H1.fontFamily = "Helvetica, sans-serif"You can also link to a font definition file and download it when a browser loads the web page, guaranteeing that all the fonts are available on a user's system. See Dynamic HTML in Netscape Communicator.
styleObject.fontSize =
{absoluteSize | relativeSize | length | percentage}
fontSize
property is a reflection of the cascading style sheet font-size
property. By default, the initial value is medium
.
styleObject.fontStyle = styleType
styleObject | |
styleType |
fontStyle
property is a reflection of the cascading style sheet font-style
property.
styleObject.fontWeight = {absolute | relative | numeric}
styleObject | |
absolute | |
relative | |
numeric |
fontWeight
property is a reflection of the cascading style sheet font-weight
property.
styleObject.lineHeight = {number | length | percentage | normal}
lineHeight
property is a reflection of the cascading style sheet line-height
property.
When you set the lineHeight
property by specifying number
, Navigator calculates the line height by multiplying the font size of the current element by number
. For example, if lineHeight
is set to 1.2 in a paragraph using a 10-point font, the line height is 12 points.
When you set lineHeight
with number
, children of the current paragraph inherit the line height factor; when you set lineHeight
with length
or percentage
, children inherit the resulting value.
styleObject.listStyleType = styleType
styleObject | |
styleType |
listStyleType
property is a reflection of the cascading style sheet list-style-type
property.
styleObject.marginBottom = {length | percentage | auto}
marginBottom
property is a reflection of the cascading style sheet margin-bottom
property.
Style.marginLeft
, Style.marginRight
, Style.marginTop
, Style.margins
styleObject.marginLeft = {length | percentage | auto}
marginLeft
property is a reflection of the cascading style sheet margin-left
property.
Style.marginBottom
, Style.marginRight
, Style.marginTop
, Style.margins
styleObject.marginRight = {length | percentage | auto}
marginRight
property is a reflection of the cascading style sheet margin-right
property.
Style.marginBottom
, Style.marginLeft
, Style.marginTop
, Style.margins
margins(top, right, bottom, left)
margins
method is a convenience shortcut for setting all the margin properties.
Style.marginBottom
, Style.marginLeft
, Style.marginRight
, Style.marginTop
styleObject.marginTop = {length | percentage | auto}
marginTop
property is a reflection of the cascading style sheet margin-top
property.
Style.marginBottom
, Style.marginLeft
, Style.marginRight
, Style.margins
styleObject.paddingBottom = {length | percentage}
styleObject | |
length |
A string evaluating to a size followed by a unit of measurement; for example, |
percentage |
A string evaluating to a percentage of the parent element's width; for example, |
paddingBottom
property is a reflection of the cascading style sheet padding-bottom
property.
Style.paddingLeft
, Style.paddingRight
, Style.paddingTop
, Style.paddings
styleObject.paddingLeft = {length | percentage}
styleObject | |
length |
A string evaluating to a size followed by a unit of measurement; for example, |
percentage |
A string evaluating to a percentage of the parent element's width; for example, |
paddingLeft
property is a reflection of the cascading style sheet padding-left
property.
Style.paddingBottom
, Style.paddingRight
, Style.paddingTop
, Style.paddings
styleObject.paddingRight = {length | percentage}
styleObject | |
length |
A string evaluating to a size followed by a unit of measurement; for example, |
percentage |
A string evaluating to a percentage of the parent element's width; for example, |
paddingRight
property is a reflection of the cascading style sheet padding-right
property.
Style.paddingBottom
, Style.paddingLeft
, Style.paddingTop
, Style.paddings
paddings(top, right, bottom, left)
paddings
method is a convenience shortcut for setting all the padding properties.
Style.paddingBottom
, Style.paddingLeft
, Style.paddingRight
, Style.paddingTop
styleObject.paddingTop = {length | percentage}
styleObject | |
length |
A string evaluating to a size followed by a unit of measurement; for example, |
percentage |
A string evaluating to a percentage of the parent element's width; for example, |
paddingTop
property is a reflection of the cascading style sheet padding-top
property.
Style.paddingBottom
, Style.paddingLeft
, Style.paddingRight
, Style.paddings
styleObject.textAlign = alignment
styleObject | |
alignment |
textAlign
with align
, which specifies the alignment of an HTML element within its parent.
The textAlign
property is a reflection of the cascading style sheet text-align
property.
styleObject.textDecoration = decoration
styleObject | |
decoration |
textDecoration
property is a reflection of the cascading style sheet text-decoration
property.
styleObject.textIndent = {length | percentage}
styleObject | |
length |
A string evaluating to a size followed by a unit of measurement; for example, |
percentage |
A string evaluating to a percentage of the parent element's width; for example, |
textIndent
property is a reflection of the cascading style sheet text-indent
property.
styleObject.textTransform = transformation
styleObject | |
transformation |
textTransform
property is a reflection of the cascading style sheet text-transform
property.
styleObject.whiteSpace = {normal | pre}
styleObject |
whiteSpace
property is a reflection of the cascading style sheet white-space
property.
styleObject.width = {length | percentage | auto}
width
property is a reflection of the cascading style sheet width
property.
The Style.marginLeft
and Style.marginRight
properties take precedence over the Style.width
property. For example, if marginLeft
is set to 25%, marginRight
is set to 10%, and width
is set to 100%, Navigator ignores the width
value and uses 65% for the width
setting.
Last Updated: 05/28/99 12:00:32