简体   繁体   English

防止文本换行到下一行

[英]Prevent text wrapping to next line

I am newbie in Twitter Bootstrap. 我是Twitter Bootstrap中的新手。 It is a very simple question. 这是一个非常简单的问题。

Here is the image: 这是图像:

段

And here is my Code : 这是我的代码

<div class="col-md-8 col-xs-6 col-sm-6  placeholders">
  <p id="people-things" class="text-center"><a href="#">PEOPLE-THINGS RECOMENDATION</a></p>
</div>

Problem : I want to put the Recomendation text in one line other then going in next line. 问题 :我想把Recomendation文本放在一行中,然后放在下一行。

Infos : I had tried every grid in but still couldn't sort it out. 信息 :我曾尝试过每一个网格,但仍无法解决问题。

You have to make smaller font-size on .people-things or add this CSS: 您必须在.people-things上制作较小的font-size或添加此CSS:

.people-things { white-space: nowrap; }

Which is making .people-things to show on one line. 这就是人们在一条线上展示.people-things

The solution above works but bootstrap grid classes should be ideally used by itself and you should not need any custom styles on top of it. 上面的解决方案可行,但引导网格类本身应该理想地使用,你不应该在它之上需要任何自定义样式。
Try rearranging your grid structure such that apply <col-sm-6> before <col-xs-6> . 尝试重新排列网格结构,以便在<col-xs-6>之前应用<col-sm-6> <col-xs-6> That will allow more space in the grid cell to fit the text. 这将允许网格单元格中的更多空间适合文本。 Also you might not need three levels of grid nesting. 您也可能不需要三级网格嵌套。 You could use: <col-md-8><col-sm-8> and see if that works. 您可以使用: <col-md-8><col-sm-8>并查看是否有效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM