javascript設定css屬性

來源:互聯網
上載者:User

1.透明度:

mso-ascii-theme-font:minor-latin;mso-fareast-font-family:宋體;mso-fareast-theme-font:
minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;
color:red">如果沒有為一個文本指定一個背景顏色或者一個背景映像,那麼這個元素的背景通常是透明的。

mso-ascii-theme-font:minor-latin;mso-fareast-font-family:宋體;mso-fareast-theme-font:
minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin">這一點很重要,如果一個絕對位置的且帶有文本的元素放在一個有文本的元素之上,那麼將會十分的混亂,那麼我們就可以通過設定背景圖片或者背景顏色來進行遮蓋,如果必須的話我們可以將其顯示的設定為“transparentCalibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:宋體;mso-fareast-theme-font:
minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin">”(透明的)

mso-ascii-theme-font:minor-latin;mso-fareast-font-family:宋體;mso-fareast-theme-font:
minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin">通用的設定透明元素通用的cssmso-ascii-theme-font:minor-latin;mso-fareast-font-family:宋體;mso-fareast-theme-font:
minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin">如下:

opacity:.75;//ff new

-moz-opacity:.75;// transparency for older Mozillas

filter:Alpha(opacity=75);//for IE

mso-ascii-theme-font:minor-latin;mso-fareast-font-family:宋體;mso-fareast-theme-font:
minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin">2.帶有連字號的css:

 

mso-ascii-theme-font:minor-latin;mso-fareast-font-family:宋體;mso-fareast-theme-font:
minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin">駱駝式命名:

element.style.fontFamily  = “sans-serif”;

element.style.borderLeftWidth  =  “5px”;

element.style.zIndex = 100;

 

mso-ascii-theme-font:minor-latin;mso-fareast-font-family:宋體;mso-fareast-theme-font:
minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin">3注意的地方:

代碼var padding_left = 50;
element.style.left = padding_left + “px”;//不要忘記加單位

var topMargin = 10,rigntMargin = 11,bottomMargin = 12,leftMargin = 13;
element.style.margin = topMargin + ”px” + rigntMargin + “px” + bottomMargin + “px” + leftMargin + “px”;

mso-ascii-theme-font:minor-latin;mso-fareast-font-family:宋體;mso-fareast-theme-font:
minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin">4.設定float

mso-ascii-theme-font:minor-latin;mso-fareast-font-family:宋體;mso-fareast-theme-font:
minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin">

element.style.cssFloat = “left”;//firefox chrome opera
element.style.styleFloat = “left”;//IE

 

mso-ascii-theme-font:minor-latin;mso-fareast-font-family:宋體;mso-fareast-theme-font:
minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin">

 

mso-ascii-theme-font:minor-latin;mso-fareast-font-family:宋體;mso-fareast-theme-font:
minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin">

mso-ascii-theme-font:minor-latin;mso-fareast-font-family:宋體;mso-fareast-theme-font:
minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin">

mso-ascii-theme-font:minor-latin;mso-fareast-font-family:宋體;mso-fareast-theme-font:
minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin">

mso-ascii-theme-font:minor-latin;mso-fareast-font-family:宋體;mso-fareast-theme-font:
minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin">

mso-ascii-theme-font:minor-latin;mso-fareast-font-family:宋體;mso-fareast-theme-font:
minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin">

mso-ascii-theme-font:minor-latin;mso-fareast-font-family:宋體;mso-fareast-theme-font:
minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin">

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.