比如我我有这样一段文本:
Shanghai Golden Ferry International Trade Co., Ltd. is located in Pudong New District of Shanghai, China. What we do now are concerning about living and life. Our Philosophy is to create better living conditions但是我使用
word-break : break-all;
word-wrap : break-word;
的时候会出现最后的英文单词被截断了,如果不使用,又不能自动换行。
使用后成了这样了:
Shanghai Golden Ferry International Trade Co., Ltd. is located in Pud
ong New District of Shanghai, China. What we do now are concerning ab
out living and life. Our Philosophy is to create better living conditions.这样该怎么解决。望高人指点一下!

解决方案 »

  1.   

    <div style="width:200px;word-break : normal;word-wrap : normal;
    ">Shanghai Golden Ferry International Trade Co., Ltd. is located in Pudong New District of Shanghai, China. What we do now are concerning about living and life. Our Philosophy is to create better living conditions</div>
      

  2.   

    CSS的,使用楼上的样式word-break : normal;word-wrap : normal;
      

  3.   

    使用1楼的方法对这一段英文可以解决,但是我的是从MySQL数据库中读出数据的,显示之后还是不行。
    这个是我的CSS代码:
    #main table {
    table-layout: fixed;
    word-break : normal;
    word-wrap : normal;
    border-top: 1px solid #ddd;
    width: 630px;
    }
    从数据库读出时,不会自动换行了。但是换成
    word-break : normal;
    word-wrap : break-word;
    之后,可以换行。但有出现之前的问题了。
    这是从数据库读出字段Publications(保存为 TEXT),unhtml()是一个转义函数。
    <tr>
        <td><p align="left" class="STYLE1">Publications:</p>
        <?php echo unhtml($result[i]['Publications']);?></td>
     </tr>结果还是会出现断开英文字母,而且还有一个比较奇怪的地方就是遇到 ‘-’符号时,也还是回自动换行。像这样子:
    1.Formal Design for RBAC Security Policy in Multi-
    domain
     Interoperation   Environment,National Natural Science Foundation of China, 11071271
    会不会是从数据库读出数据时,出问题了。或者转义的时候出问题了。