Pregunta

I have a site that uses the Twitter Bootstrap framework which renders without errors in all browsers. However, when I plug the main URL of our site into the W3C validator it spits out 1,465 errors, most of which are parsing errors.

A few examples:

Parse Error {*zoom:1; Value Error : background-color Too many values or values are not recognized : #3f6998 \000009

I understand the * and \000009 are IE specific, so it is important that these are failing validation?

Is there a validator that takes these into consideration?

¿Fue útil?

Solución

You will always get css validation error while using CSS3. Most of the styles(css3) are not valid under w3 rules as of now.. You can simply ignore these errors and move ahead.. Just make sure you do not have any other validation issues other than those with css3 styles. If so you are perfectly fine..

Update :

You can try something like this :

http://jigsaw.w3.org/css-validator/validator?profile=css3&uri=PATH_TO_YOUR_WEBSITE

For eg :

http://jigsaw.w3.org/css-validator/validator?profile=css3&uri=http://stackoverflow.com

Still it will show lot of errors. There are no CSS3 validators yet implemented which is accepted.

[Updated]

URL : https://validator.w3.org/

Please use the official validator.

Otros consejos

Here is Bootstrap’s explanation for their validation errors:

https://getbootstrap.com/docs/getting-started/#support-validators

In order to provide the best possible experience to old and buggy browsers, Bootstrap uses CSS browser hacks in several places to target special CSS to certain browser versions in order to work around bugs in the browsers themselves. These hacks understandably cause CSS validators to complain that they are invalid. In a couple places, we also use bleeding-edge CSS features that aren't yet fully standardized, but these are used purely for progressive enhancement. These validation warnings don't matter in practice since the non-hacky portion of our CSS does fully validate and the hacky portions don't interfere with the proper functioning of the non-hacky portion, hence why we deliberately ignore these particular warnings.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top