情景复原:
问题分析:
可能是你加载了bootstrap.js,bootstrap.js中为label加了样式:max-width:100%;
解决方法:
设置maxWidth:"none"
如:
label.setStyle({
color : "red",
maxWidth:"none", //去除bootstrap中样式
fontSize : "12px",
height : "20px",
lineHeight : "20px",
fontFamily:"微软雅黑"
});
效果展示: