一、实现效果 二、代码 文本不换行: white-space: nowrap; 超出隐藏: overflow: hidden; 超出的文字用省略号代替: text-overflow: ellipsis; .smallname { text-align: center; color: #fff; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; width: 100%; }