For more information about how to set css attributes using javascript, see.
1. Transparency:
If you do not specify a background color or a background image for a text, the background of this element is usually transparent.
This is very important. If an absolutely positioned element with text is placed on a text element, it will be very confusing, then we can set the background image or background color to cover it. If necessary, we can set it to "transparent" (transparent)
General settings Transparent Elements General css is as follows:
The Code is as follows:
Opacity:. 75; // ff new
-Moz-opacity:. 75; // transparency for older extends illas
Filter: Alpha (opacity = 75); // for IE
2. css with a hyphen:
Camel naming:
The Code is as follows:
Element. style. fontFamily = "sans-serif ";
Element. style. borderLeftWidth = "5px ";
Element. style. zIndex = 100;
3. Notes:
The Code is as follows:
Var padding_left = 50;
Element. style. left = padding_left + "px"; // do not forget to add Unit
Var topMargin = 10, rigntMargin = 11, bottomMargin = 12, leftMargin = 13;
Element. style. margin = topMargin + "px" + rigntMargin + "px" + bottomMargin + "px" + leftMargin + "px ";
4. Set float
The Code is as follows:
Element.style.css Float = "left"; // firefox chrome opera
Element. style. styleFloat = "left"; // IE