10

I need to validate a CSS3 file where I'm using the following code:

width:calc(96.3% - 312px)

It returns this error:

Value Error : width Parse Error - 312px)

My last choice is to use a Javascript function on page load and window resize to get the width value when it's possible using CSS3 (only for IE8 or older).

BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
Unix
  • 1,358
  • 3
  • 14
  • 23

1 Answers1

14

This appears to be a bug in the validator. Your calc() syntax is valid. Don't worry about it.

Whenever you need to validate your CSS, remove just that declaration so it does not cause irrecoverable parse errors.

BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
  • 4
    Oh I see, thank you. Now I found the bug: https://www.w3.org/Bugs/Public/show_bug.cgi?id=18913. Is there a method to hide/remove a declaration without editing the code? Thanks. – Unix Jul 11 '14 at 11:54
  • 1
    @Gerard: I don't think so. – BoltClock Jul 11 '14 at 12:04
  • 1
    unfortunately this bug is still there almost two years later - I just found this question&answer here after having the same problem validating and googling for it... – Johannes Apr 11 '16 at 00:04