Vue项目中,给div添加多个样式,但是页面显示及审查元素时,均缺少最后一个样式background-color,将最后一个样式改为行内样式时,无此问题。css预处理器为stylus,代码如下:
height 100%
margin-left 10px
background-color skyblue
.header
height 40px
line-height 40px
原因:子元素的类名前多了空格。
解决方案:修改后的代码如下:
margin-left 10px
background-color skyblue
.header
height 40px
line-height 40px