1

I am using box-sizing with vendor prefixes, like this

...running it through the CSS validator

...and getting this error: Property -moz-box-sizing doesn't exist : border-box

Is there a way to make it pass?

Many thanks.

Mr. Alien
  • 153,751
  • 34
  • 298
  • 278
  • 1
    No, there isn't. Ignore the "error" and move on - the W3C validator is extremely picky, and doesn't acknowledge any sort of "exception" or "extention". If it's not in the official standards documentation, it's not valid. – Marc B Jul 24 '12 at 15:32
  • 1
    possible duplicate of [How to validate vendor prefixes in CSS like -webkit- and -moz-?](http://stackoverflow.com/questions/1889724) – BoltClock Jul 24 '12 at 15:34
  • possible duplicate of [How to validate vendor prefixes in CSS like -webkit- and -moz-?](http://stackoverflow.com/questions/1889724/how-to-validate-vendor-prefixes-in-css-like-webkit-and-moz) – Marc B Jul 24 '12 at 15:51

2 Answers2

0

No. CSS3 is in BETA mode, browsers need to have prefixes because some properties have different values. In the future this will be one standard, the W3C CSS level 3 standard. Then the prefixes will be removed.

However, we need to use prefixes today and prefixes aren't really CSS, they are just an indicator for a browser which of the properties it will parse. And because they aren't CSS the CSS validator wouldn't pass.

But a 'valid' page doesn't say anything. Don't worry about some errors in your CSS/HTML, fix only the ones who are critical.

Wouter J
  • 41,455
  • 15
  • 107
  • 112
  • @Christoph well you are correct. But FF12 and IE10 are going the right way, gradients and a lot more get unprefixed! – Wouter J Jul 24 '12 at 15:44
0

As Browservendors try to implement the new css features, they add prefixes, as long as they are not 100% conform to the css-standard. These vendor-prefixes are not part of the official CSS-specification and thus produce errors when run through the css-validator.

However, you could try PrefixFree if you are absolutely keen on having standard-conform css.

Christoph
  • 50,121
  • 21
  • 99
  • 128
  • Thanks for both responses. Much appreciated. I will have a look at PrefixFree. Many thanks. – user1549184 Jul 25 '12 at 08:06
  • @user1549184 you are welcome. One sidenote though: try to avoid w3chools as your primary source for education, they have a lot of errors and even false information. Check out http://w3fools.com/ - the section "WHAT" contains a list of some very good resources, where you can get reliable, up-to-date information. Personally I prefer MDN. – Christoph Jul 25 '12 at 08:09