1. 单行
.ellipsis { 250px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
2. 多行css实现
<div className="group-package-pickup__detail-content"> <div className="group-package-pickup__detail-content-text"> Call me Ishmael.Call me Ishmael. </div> </div> .group-package-pickup__detail-content { overflow: hidden; position: absolute; top: 25px; bottom: 0; min-height: 20px; max-height: 40px; } .group-package-pickup__detail-content:before { content: ""; float: left; 5px; height: 100%; } .group-package-pickup__detail-content-text { float: right; 100%; margin-left: -5px; } .group-package-pickup__detail-content:after { content: "