tags:

views:

49

answers:

1

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; 
    width: 800px; 
    overflow: auto;
}

What's with all the different keywords following 'white-space:' ?

What does white-space: -o-pre-wrap; do?

+2  A: 

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

rahul
I think one may be just for Mozilla and the other is for all other browsers?
tahdhaze09