Style

Team-Fly    

 
Webmaster in a Nutshell, 3rd Edition
By Robert Eckstein, Stephen Spainhour
Table of Contents
Chapter 11.  JavaScript


Style DOM Level 2; IE 4

Inline CSS properties of an element
  element  .style 

Properties

The Style object defines a large number of properties: one property for each CSS attribute defined by the CSS2 specification. The property names correspond closely to the CSS attribute names , with minor changes required to avoid syntax errors in JavaScript. Multiword attributes that contain hyphens, such as font-family are written without hyphens in JavaScript, and each word after the first is capitalized: fontFamily. Also, the float attribute conflicts with the reserved word float, so it translates to the property cssFloat.

The visual CSS properties are listed in the following table. Since the properties correspond directly to CSS attributes, no individual documentation is given for each property. See a CSS reference (such as Cascading Style Sheets: The Definitive Guide by Eric A. Meyer, published by O'Reilly) for the meaning and legal values of each. Note that current browsers do not implement all of these properties.

All of the properties are strings, and care is required when working with properties that have numeric values. When querying such a property, you must use parseFloat( ) to convert the string to a number. When setting such a property you must convert your number to a string, which you can usually do by adding the required units specification, such as "px".

 background 
 counterIncrement 
 orphans 
 backgroundAttachment 
 counterReset 
 outline 
 backgroundColor 
 cssFloat 
 outlineColor 
 backgroundImage 
 cursor 
 outlineStyle 
 backgroundPosition 
 direction 
 outlineWidth 
 backgroundRepeat 
 display 
 overflow 
 border 
 emptyCells 
 padding 
 borderBottom 
 font 
 paddingBottom 
 borderBottomColor 
 fontFamily 
 paddingLeft 
 borderBottomStyle 
 fontSize 
 paddingRight 
 borderBottomWidth 
 fontSizeAdjust 
 paddingTop 
 borderCollapse 
 fontStretch 
 page 
 borderColor 
 fontStyle 
 pageBreakAfter 
 borderLeft 
 fontVariant 
 pageBreakBefore 
 borderLeftColor 
 fontWeight 
 pageBreakInside 
 borderLeftStyle 
 height 
 position 
 borderLeftWidth 
 left 
 quotes 
 borderRight 
 letterSpacing 
 right 
 borderRightColor 
 lineHeight 
 size 
 borderRightStyle 
 listStyle 
 tableLayout 
 borderRightWidth 
 listStyleImage 
 textAlign 
 borderSpacing 
 listStylePosition 
 textDecoration 
 borderStyle 
 listStyleType 
 textIndent 
 borderTop 
 margin 
 textShadow 
 borderTopColor 
 marginBottom 
 textTransform 
 borderTopStyle 
 marginLeft 
 top 
 borderTopWidth 
 marginRight 
 unicodeBidi 
 borderWidth 
 marginTop 
 verticalAlign 
 bottom 
 markerOffset 
 visibility 
 captionSide 
 marks 
 whiteSpace 
 clear 
 maxHeight 
 widows 
 clip 
 maxWidth 
 width 
 color 
 minHeight 
 wordSpacing 
 content 
 minWidth 
 zIndex 

Team-Fly    
Top


Webmaster in a Nutshell
Webmaster in a Nutshell, Third Edition
ISBN: 0596003579
EAN: 2147483647
Year: 2002
Pages: 412

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net