p标签内容超出列宽

时间:2016-05-30 06:45:28

标签: html5 css3 twitter-bootstrap-3

我有一排。在行内,有一个名为.col-md-6的类。 在列中,我有一个带有一些文本的段落标记。 问题是,段落标记的内容超出了列宽。但我希望段落标记内容在列中正确对齐,如图所示。  代码:

<div class="row">
    <div class="col-md-6 col-xs-12 col-sm-6">
        <p>TextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextText</p>
    </div>   
</div>

链接: http://jsbin.com/zimuwonoyu/edit?html,output

我希望它像图像中所示的那样: enter image description here

2 个答案:

答案 0 :(得分:1)

有一个CSS属性。

p {
  word-wrap: break-word;
}

答案 1 :(得分:1)

CSS属性:

p{
 white-space: normal;
 word-wrap: break-word;
 }