Ale*_*art 20 javascript css php jquery
我有文字喜欢
<div style="float:left; width: 250px"> PellentesquePellentesquePellentesquePellentesquePellentesquePellentesquePellentesquePellentesquePellentesquePellentesquePellentesquePellentesquePellentesquePellentesquePellentesque  feugiat tempor elit. 
Ut mollis lacinia quam. Sed pharetra, augue aliquam   ornare vestibulum, metus massalaoreet tellus, eget iaculis lacus ipsum et diam. </div>
我不想要水平滚动.是否可以包装文本(自动换行).我知道有一些IE特定的属性.
感谢您的时间.
更新:我也可以使用jQuery,Javascript,PHP来做到这一点.但怎么样?我的意思是字母(字体)不是固定宽度或任何你称之为.
Dav*_*man 46
我用的是组合
word-wrap: break-word;
overflow: hidden;
处理这个.该word-wrap设置将允许在支持该属性的浏览器中尽管其长度被包装,而该overflow设置将使其在无法识别的浏览器中的可用空间的末尾被切断word-wrap.这就像你可能在不使用javascript的情况下获得的优雅降级一样.
小智 6
根据http://www.w3.org/TR/css3-text/#word-break0
word-break: break-all;
...与word-wrap(现在重命名为overflow-wrap)不同,因为即使是小字也可能在它们位于行尾时被破坏.但它的确有效.
在极少数情况下,hyphen: auto;可能会为您带来更好的结果,但前提是您的长词包含在浏览器使用的词典中.
| 归档时间: | 
 | 
| 查看次数: | 21519 次 | 
| 最近记录: |