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

2017-07-18  本文已影响69人  温柔你要送嘻嘻

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;

}

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

上一篇 下一篇

猜你喜欢

热点阅读