如果只顯示一行,則可以使用以下方法: overflow: hidden; text-overflow:ellipsis; white-space: nowrap; 如果需要顯示 ...
1 ...
.title{ font-size: .7rem; line-height: 1.5rem; overflow: hidden; /** 隱藏超出的內容 **/ word-break: break-all ...
先看看最簡單的,利用 text-overflow:ellipsis 實現單行文本溢出顯示省略號效果 效果如下: 所有主流瀏覽器都支持 text-overflow 屬性。但這個屬性僅適用於單行文本,多行的情景遠比單行復雜。 1.利用 ...
overflow: hidden; text-overflow:ellipsis; white-space: nowrap;限制行數 overflow: hidden; t ...
*/}.css2 { overflow: hidden; /*自動隱藏文字*/ text-overflo ...
.view-text{ /** a.設置inline-block 屬性 b.強制不換行 c.固定寬度 d.隱藏超出部分 e.顯示“……” */ display: inline-block; white-space: nowrap; width: 100 ...