1. Transparency:
If you don't specify a background color or a background image for a text, the background of the element is usually transparent.
This is important, if an absolutely positioned and text element is placed on top of a text element, it will be very confusing, so we can cover it by setting the background image or background color, and if necessary we can set it to "transparent" (transparent)
Common CSS for setting transparent elements is as follows:
Copy Code code as follows:
OPACITY:.75;//FF New
-moz-opacity:.75;//Transparency for older Mozillas
Filter:alpha (opacity=75);//for IE
2. CSS with hyphens:
Camel-style naming:
Copy Code code as follows:
element.style.fontFamily = "Sans-serif";
Element.style.borderLeftWidth = "5px";
Element.style.zIndex = 100;
3. Places of Attention:
Copy Code code as follows:
var padding_left = 50;
Element.style.left = padding_left + "px";/Don't forget to add a unit
var topMargin = 10,rigntmargin = 11,bottommargin = 12,leftmargin = 13;
Element.style.margin = TopMargin + "px" + rigntmargin + "px" + bottommargin + "px" + leftMargin + "px";
4. Set float
Copy Code code as follows:
Element.style.cssFloat = "Left";//firefox Chrome Opera
Element.style.styleFloat = "Left";//ie