打破字使用css [英] breaking words using css

查看:127
本文介绍了打破字使用css的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

code>< p> 标记太长,它看起来像这样,如何防止这与css?我试过css属性 word-break:break-all; 但Firefox和Opera不支持此属性,除此之外,其他正常单词也打破。所以我只想打破非常长的字,而不是短的字,取决于白色的宽度< div>

When the text in <p> tag is too long, it appears like this, how to prevent this with css? I've tried the css property word-break: break-all; but Firefox and Opera doesn't support this property, and besides that other "normal" words also breaking. So I want to break only very long words, but not short words, depending on width of white <div>

您可以查看更多信息: http://jsfiddle.net/Le4zK/16/

You can check out this for more: http://jsfiddle.net/Le4zK/16/

提前感谢。

推荐答案

$ c> word-wrap:break-word; 而不是 word-break:break-all;

Write this word-wrap: break-word; instead of word-break: break-all;

编辑:

也许这是 display:table 属性。我在css中做了一些更改:
中<显示:> c

Maybe this a bug with display:table property. I did some changes in css: Put display:table in parent div.

.post{
    background-color: #fff;
    float: left;
    clear: both;
    padding: 20px;
    width: 500px;
    border-bottom: solid 1px #ddd;
    display:table;
}

删除 display:table-cell 来自 .post_body css:

.post_body{
    width: 580px;
    opacity: 0.8;
}

检查示例适用于您。

这篇关于打破字使用css的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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