在流体容器内连接文本 [英] Concatenating text within fluid container

查看:86
本文介绍了在流体容器内连接文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个源自该问题的问题:



如何获得这一个正确的?

解决方案

您可以简单地设置:

  width:100%; 

请参阅修改的小提琴: http://jsfiddle.net/blocknotes/jguaxbsg/2/



如果有足够的空间窗口,你可以看到整个句子,如果你限制窗口的省略号似乎削减了字符串。


It's a problem that derived originally from that one: Header misbehave on longer title

I'm using now:

    .toolong {
        width: 230px;
        overflow:hidden; 
        white-space:nowrap; 
        text-overflow: ellipsis;
    }

with @media (min-max width etc.) and I want it to make width adapt to actual width of the container, not the screen width. Why is that? Because under, let's say, 768px I have stacked all the columns and container gets quite long with lot of unused space:

How to get this one right?

解决方案

You could simply set:

width: 100%;

See the modified Fiddle: http://jsfiddle.net/blocknotes/jguaxbsg/2/

If there is enough space on the window you can see the whole sentence, if you restrict the window the ellipsis appear to cut the string.

这篇关于在流体容器内连接文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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