问题描述
在webpack + autoprefixer,打包后,如果CSS中含有box-flex 和 box-orient,或者写成-webkit-box-flex 和 -webkit-box-orient
那么这2个属性在打包后的文件中,不会存在。
原因
box-flex 和 box-orient这2个CSS属性,目前没有浏览器支持,autoprefixer就会把这个当成无效属性,打包后的文件自然也就不会存在了。
解决方法
CSS改成如下:
/*! autoprefixer: off */ -webkit-box-orient: vertical; /* autoprefixer: on */
/*! autoprefixer: off */ -webkit-box-flex: 1; /* autoprefixer: on */
Web前端(W3Cways.com) - Web前端学习之路