2011年4月5日星期二

英文断词换行的麻烦事

发帖者 Sparkhandle 时间: 21:32
当换上新模板后发现如果换行出是英文的话,单词会被段开,上部分在上一行显示,没有连接号,单词的下部分在下一行接着。
虽然这样会显得比较整齐,但真正阅读时会造成困难,不好——于是改。
找到div,p把后面{}里的word-break:break-all;删除,留下word-wrap:break-word;
关于CSS里的定义,找了几篇文章看了,不是太清楚。如果用某些地方介绍的word-wrap:break-word; overflow:hidden; 这样的语句,我的页面会显示不正常!

下面是关于word-wrap,word-break的不同定义会出现的不同情况。不了解原理,照搬了。

正常

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 1111111111111111111111111111111111111111111111111111111111111 Load-time errors are those that are caught by JavaScript as Netscape loads the script. These errors are the major mistakes that prevent the script from functioning before it has a chance to start.http://spark-end.blogspot.com/2011/04/word-wrap-word-break.html

  • div{word-wrap:break-word;}

    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 1111111111111111111111111111111111111111111111111111111111111 Load-time errors are those that are caught by JavaScript as Netscape loads the script. These errors are the major mistakes that prevent the script from functioning before it has a chance to start.http://spark-end.blogspot.com/2011/04/word-wrap-word-break.html...........................................................................................................................................
  • div{word-break:break-all;}

    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 1111111111111111111111111111111111111111111111111111111111111 Load-time errors are those that are caught by JavaScript as Netscape loads the script. These errors are the major mistakes that prevent the script from functioning before it has a chance to start. http://spark-end.blogspot.com/2011/04/word-wrap-word-break.html ...........................................................................................................................................
  • td{word-wrap:break-word;}

    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 1111111111111111111111111111111111111111111111111111111111111 Load-time errors are those that are caught by JavaScript as Netscape loads the script. These errors are the major mistakes that prevent the script from functioning before it has a chance to start. http://spark-end.blogspot.com/2011/04/word-wrap-word-break.html...........................................................................................................................................
  • td{word-wrap:break-word;width:10em;}

    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 1111111111111111111111111111111111111111111111111111111111111 Load-time errors are those that are caught by JavaScript as Netscape loads the script. These errors are the major mistakes that prevent the script from functioning before it has a chance to start. http://spark-end.blogspot.com/2011/04/word-wrap-word-break.html...........................................................................................................................................
  • td{word-break:break-all;}

    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 1111111111111111111111111111111111111111111111111111111111111 Load-time errors are those that are caught by JavaScript as Netscape loads the script. These errors are the major mistakes that prevent the script from functioning before it has a chance to start. http://spark-end.blogspot.com/2011/04/word-wrap-word-break.html ...........................................................................................................................................
  • td{word-break:break-all;width:10em;}

    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 1111111111111111111111111111111111111111111111111111111111111 Load-time errors are those that are caught by JavaScript as Netscape loads the script. These errors are the major mistakes that prevent the script from functioning before it has a chance to start. http://spark-end.blogspot.com/2011/04/word-wrap-word-break.html ...........................................................................................................................................
  • div{word-wrap:break-word;word-break:break-all;}

    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 1111111111111111111111111111111111111111111111111111111111111 Load-time errors are those that are caught by JavaScript as Netscape loads the script. These errors are the major mistakes that prevent the script from functioning before it has a chance to start. http://spark-end.blogspot.com/2011/04/word-wrap-word-break.html ...........................................................................................................................................
  • Related Posts with Thumbnails

    0 评论:

    发表评论