情景復原:
問題分析:
可能是你加載了bootstrap.js,bootstrap.js中爲label加了樣式:max-width:100%;
解決方法:
設置maxWidth:"none"
如:
label.setStyle({
color : "red",
maxWidth:"none", //去除bootstrap中樣式
fontSize : "12px",
height : "20px",
lineHeight : "20px",
fontFamily:"微軟雅黑"
});
效果展示: