html>
浮动去空格
button{margin:0;}
/*这里clear:both,为的就是当左浮动之后,这个p不会跟着去浮动,如果设置none,那么p元素会跟着浮动*/
p{clear:both;}
按钮1
按钮2
按钮3
按钮4
vartrigger=document.getElementById("trigger"),
buttons=document.getElementsByTagName("button");
varlength=buttons.length;
if(trigger&&length>0){
trigger.onclick=function(){
for(varindex=0;index
buttons[index].style["cssFloat"intrigger.style?"cssFloat":"styleFloat"]="left";
}
};
}
其中buttons[index].style["cssFloat" in trigger.style? "cssFloat": "styleFloat"] = "left"; 这个是啥意思?没见过这种写法