1,CSS 让超出DIV宽度范围的文字自动显示省略号…
.div{ font-family: ms sans serif, arial; font-size: 8pt; width: 100; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; } 关键是:text-overflow: ellipsis;
2,div显示固定在一个位置
.grd1 {width:316px; height:40px; position:relative;margin:0px;padding:0px;} .grd1 a{position: absolute; top:18px; left:266px;} <div class="grd1">{{$item->txt_body|mb_strimwidth:0:75:"…"}} <a href="http://www.huaidong.net/" target="_blank">查看全文</a> </div> 说明:“查看全文”位置固定是相对txt_body的
友链已加! 合作愉快
简洁的技术类博客 支持
可以交换友链吗?我已经在我的网站里加好你的了
链接已做好,以前学过网页设计后私事而放弃,学PHP语言容易吗?我也很想学。
呵呵,来踩踩。。。
好像是只有IE支持吧,对于FF 只能 用hidden了。
这个不错….
你好路过,顺便给你踩踩。
顺便给你踩踩。
不仅
text-overflow: ellipsis;是关键,overflow: hidden; white-space: nowrap;也是关键,还有做Firefox下不会有省略号。兄弟你说的很对
读者墙那样的效果 如何用css约束其行数 和列数,求教