简单理解 word-wrap、word-break 和 white-space 的区别

不设置word-warp和word-break的时候,一行单词,超过了容器的宽度是,会将最后一个单词下移一行进行显示,如果下移的那个单词长度还是超过了容器宽度,则会溢出

word-wrap

设置word-wrap: break-word时,先把长单词移动到下一行,然后如果还是超出容器宽度,则进行单词内的断句换行

后面的单词同上述规则

word-break

当上述情况,长单词移动到下一行的时候,第一行会有一定空余的空间,较为浪费资源。
于是通过设置word-break: break-all,长单词不移动到下一行,直接在当前行进行断句换行

white-space

作用于空格和回车,用于控制空格是否合并、回车是否可折行、句子太长是否在空格处折行

常用取值不同的作用:

  • normal: 默认。空白会被浏览器忽略。
  • pre: 空白会被浏览器保留。其行为方式类似 HTML 中的
    标签。
  • nowrap: 文本不会换行,文本会在在同一行上继续,直到遇到
    标签为止。
  • pre-wrap: 保留空白符序列,但是正常地进行换行。
  • pre-line: 合并空白符序列,但是保留换行符。
  • inherit: 规定应该从父元素继承 white-space 属性的值。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
System Stability Tester began as a system stressing and benchmarking tool for overclockers, by the Greek pctechnology and overclockers community, the first months of 2005. Since its first release 0.1 is free and open source software. When version 0.7 came out in June 2007, the project moved to sourceforge.net in order to ease its distribution and gain popularity. How it works System Stability Tester tries to test the system's stability by calculating up to 128 millions of Pi digits. It supports multiple calculation algorithms. For the moment only two have been implemented. The Quadratic Convergence of Borwein and Gauss-Legendre, the algorithm SuperPi uses. The testing process includes the creation of two or more threads. After each step of the calculation, the results of all the threads are compared. Any differences between them are reported. There is also the option for single threaded calculation, but in this case there is no stability check. This is useful for benchmarking purposes only. The calculation of Pi itself is multi threaded since version 0.7.2, for the Borwein algorithm only. What System Stability Tester can do in brief Calculate up to 128 million digits of Pi. Create up to 32 threads. Recognize the CPU model, manufacturer and operational frequency. Compare the calculation results of all the threads after each step and issue a warning if something went wrong. Run continuously for up to 50 turns and log the results after each step and each turn. Record the calculated digits of Pi in a human readable text file. Single threaded calculation of Pi for benchmarking, similar to the well know SuperPi benchmark. Checksum validation over the result. Provides graphical and command line user interfaces.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值