Modify Width:
document.getElementById ("Div1"). Style.width= "200px";
Modify Border-radius:
document.getElementById ("Div1"). style.borderradius= "100px";
To modify a background image:
document.getElementById ("Div1"). Style.backgroundimage= ' url (img.jpg) ';
Or:
document.getElementById ("Div1"). style.csstext= "border-radius:100px; width:200px; Background-image:url (img.jpg) ";
Attention:
1: Use style. Property name = "attribute Value" when the property name may have to be changed, such as Border-radius to become borderradius;background-image to become backgroundimage;
But when using Style.csstext, the name of the property is written in the same way as the CSS.
2: The two methods are best not to mix, when the Style.csstext set, written in the code before the Style.width and so will be invalidated.
CSS Reference manual: http://www.ziqiangxuetang.com/cssref/css-reference.html
Http://www.w3school.com.cn/h.asp
JS Modify CSS Style