سؤال

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