Reference: https://www.cnblogs.com/yangguojin/p/10301981.html
Extend beyond a single omission:
p{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
Over 2 lines is omitted:
p { overflow:hidden; text-overflow:ellipsis; display: -webkit-box; -webkit-box-align: start; //让内容居左 /*! autoprefixer: off */ -webkit-box-orient:vertical; /* autoprefixer: on */ -webkit-line-clamp:2; }
Note: Comments must be two lines! Because -webkit-box-orient is removed after webpack package, autoprefixer will automatically remove the old outdated code, so you need to add comments closed autoprefixer. If there is clear annotation plug-in, the plug-in set to false, otherwise it will not take effect.
But when the external css style for the introduction, written warning will be reported:. Second Autoprefixer control comment was ignored Autoprefixer applies control comment to whole block, not to next rules.
To be amended as follows:
/*! autoprefixer: ignore next */ -webkit-box-orient: vertical; -webkit-line-clamp: 2;