문제

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

도움이 되었습니까?

해결책

pre-wrap wasn't supported by all browsers. These days every browser support it. So it's just a fallback for old browsers.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top