What do white-space and -o-pre-wrap do in CSS?
I need some help understanding this bit of code
pre
{
white-space: pre;
white-space: -moz-pre-wrap;
white-space: -o-pre-wrap;
white-space: pre-wrap;
word-wrap: break-word;
开发者_JS百科 width: 800px;
overflow: auto;
}
What's with all the different keywords following white-space:
?
What does white-space: -o-pre-wrap;
do?
Its for different browsers.
The white-space property specifies how white-space inside an element is handled.
Read White space: the 'white-space' property
Mozilla supports a number of extensions to CSS that are prefixed with -moz-.
Read Mozilla CSS Extensions
But I don't know why two styles rules are applied for white-space property, pre and pre-wrap.
-o is for Opera.
Browser proprietary CSS extensions and DOM node prefixes
精彩评论