如
#1:2{ height:100px; width:100px; border:solid 1px red; }我这样写实不管用的。
id中含有冒号这个事实我没法改变,而且只能用id来标示css请问哪位高手会。
必须满足的条件: id中有冒号 css中只能用#id来表示
动用js就行啦!
[code="java"]var dom=document.getElementById("1:2")
//firefox下
dom.setAttribute("style","height:100px;width:100px;border:solid 1px red;");
//IE 下
dom.style.cssText="height:100px;width:100px;border:solid 1px red;";[/code]