一、单行文本
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
二、多行文本
.c_contM_word {
position: relative;
width: 80%;
max-height: 189px;
text-overflow: ellipsis;
background-color: cyan;
display: -webkit-box;
-webkit-line-clamp: 6;//超出6行隐藏
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
//或者使用伪元素
.c_contM_word {
position: relative;
width: 80%;
max-height: 189px;
text-overflow: ellipsis;
background-color: cyan;
overflow: hidden;
}
.c_contM_word::after {
content: "...."; // '...'
position: absolute;
bottom: 0;
right: 0;
padding-left: 40px;//设置伪元素的paddingleft为40px,已达到遮挡文字效果
background: -webkit-linear-gradient(left, transparent, #fff 55%);//设置padding-left线性渐变颜色~~~~
background: -o-linear-gradient(right, transparent, #fff 55%);
background: -moz-linear-gradient(right, transparent, #fff 55%);
background: linear-gradient(to right, transparent, #fff 55%);
}
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。