CSS for pre-selected item in IE

I want to define a CSS class that will provide the same style as the HTML <pre> element. I tried this:

 .mystyle { display: block; font-family: monospace; white-space: pre; } 

which works fine on FF, but not on IE (white spaces are not preserved). Somebody knows?

+4
source share
1 answer

white-space:pre is only supported on IE6 and later.

Your page is probably not DOCTYPE or has and is deprecated, which allows emulation of IE 5 in all new versions of IE.

Add HTML4 Strict DOCTYPE to your document. Make sure there is nothing else in front of DOCTYPE , because IE6 will not see it.

+7
source

Source: https://habr.com/ru/post/1277676/


All Articles