CSS:你能防止溢出:隐藏从截断文本的最后一行? [英] CSS: Can you prevent overflow: hidden from cutting-off the last line of text?

查看:491
本文介绍了CSS:你能防止溢出:隐藏从截断文本的最后一行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当使用CSS overflow:hidden时,我经常发现最后一行文本被部分截断。有没有办法防止这种情况,以便任何部分行不显示。

When using CSS overflow: hidden , I've often found that the last line of text gets partially cut-off. Is there a way to prevent this so that any partial lines do not show-up. Almost like a vertical word-wrap.

推荐答案

您可以使用wrapper div和多列css:

You can use wrapper div and multi-column css:

.wrapper {
    -webkit-column-width: 150px; //You can't use 100%
    column-width: 150px;
    height: 100%;
}

解决方案示例 http://jsfiddle.net/4Fpq2/9/

这篇关于CSS:你能防止溢出:隐藏从截断文本的最后一行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆