Twitter bootstrap 动态缩放Bootstrap3内容(主要是文本)以显示宽度?Aka响应文本大小
Bootstrap3的列显然是根据显示大小进行缩放的,但是否也可以用同样的方式缩放文本 看起来我只能设置字体大小,但一个单词或句子是否适合屏幕也取决于字符的内容数量Twitter bootstrap 动态缩放Bootstrap3内容(主要是文本)以显示宽度?Aka响应文本大小,twitter-bootstrap,text,twitter-bootstrap-3,responsive-design,font-size,Twitter Bootstrap,Text,Twitter Bootstrap 3,Responsive Design,Font Size,Bootstrap3的列显然是根据显示大小进行缩放的,但是否也可以用同样的方式缩放文本 看起来我只能设置字体大小,但一个单词或句子是否适合屏幕也取决于字符的内容数量 是否可以动态缩放一段文本,使其适合屏幕或Bootstrap3网格?使用文本溢出属性: #div1 { white-space: nowrap; width: 12em; overflow: hidden; text-overflow: clip; border: 1px solid #0
是否可以动态缩放一段文本,使其适合屏幕或Bootstrap3网格?使用文本溢出属性:
#div1 {
white-space: nowrap;
width: 12em;
overflow: hidden;
text-overflow: clip;
border: 1px solid #000000;
}
#div2 {
white-space: nowrap;
width: 12em;
overflow: hidden;
text-overflow: ellipsis;
border: 1px solid #000000;
}
<p>The following two divs contains a long text that will not fit in the box. As you can see, the text is clipped.</p>
<p>This div uses "text-overflow:clip":</p>
<div id="div1">This is some long text that will not fit in the box</div>
<p>This div uses "text-overflow:ellipsis":</p>
<div id="div2">This is some long text that will not fit in the box</div>
谢谢,但我不知道如何才能把它变成我问题的解决方案?假设我有一个Bootstrap3行,显示的是php生成的内容,例如Welcome$userName。我应该怎么做才能使文本在可用的水平空间内缩放和适应?也就是说,如果我调整浏览器窗口的大小或旋转移动设备,显示宽度会发生变化,因此文本大小应该相应地调整,以使其仍然合适。我想我的答案会解决您的问题,在PHP中无所谓:我看不出设置字体大小是以px还是em或%单位来考虑整个文本的大小或长度?字体大小主要与每个字符的大小有关。我提到php是为了表示我甚至事先不知道文本或其长度或字符数。因此,仅通过设置字体大小,我想说,无法知道整个文本是否适合或匹配当前显示宽度,或者是否存在。。?