pre-wrap
wasn't supported by all browsers. These days every browser support it. So it's just a fallback for old browsers.
Why do we this line of code in normalize.css?
-
16-07-2023 - |
题
The code below
// Improve readability of pre-formatted text in all browsers.
pre {
white-space: pre;
white-space: pre-wrap;
word-wrap: break-word;
}
is taken from https://github.com/yuanyan/pre/blob/master/src/normalize.less
Could anybody please tell me why do we need this
white-space: pre;
as the second line overrides it. I know it is needed, but who can tell me why? Is that because of the browser support? Probably not the way it is used here. What's the sense to override values?
P.S. The pre-wrap property is supported in IE8 and higher, but not IE 5-7 -that's what Alex W says here @ SO
解决方案
不隶属于 StackOverflow