div内文字显示两行,超出两行部分省略号显示css能实现么?

http://www.cnblogs.com/hellman/p/5755376.html

https://jingyan.baidu.com/article/2a138328971e8c074a134f82.html

p{

width:200px;

//overflow : hidden;

//text-overflow: ellipsis;

//display: -webkit-box;

//-webkit-line-clamp: 2;

//-webkit-box-orient: vertical;

position:relative;

line-height:1.4em;

height:4.2em;

overflow:hidden;

}

p::after{

content:"...";

font-weight:bold;

position:absolute;

bottom:0;

right:0;

padding:0 20px2px10px;

}

注释掉的代码,据说也能实现,但是在我这里不管用。最后还是用的第二种方法

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容