W3C validator, CSS3 and Bootstrap
Asked Answered
T

2

7

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?

Trollop answered 16/1, 2014 at 15:31 Comment(3)
Is it important those are failing validation? Well, if you already know why it fails and if the reason is acceptable, then no it is not important they are failing...Ecology
Short answer is NO, you can just move ahead with these errors, it's fine as far as you are using valid propertiesLiturgics
The CSS validation for CSS3 always gives errors. one reason: IE. its not possible to write valid css3 with that browser aroundTrichromatism
A
11

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.

Apeak answered 16/1, 2014 at 15:34 Comment(4)
Thanks, Roy. You would think W3C would construct validation rules that adhere to this CSS3 / IE related syntax. While none of us really want IE around, it won't go away so long as Windows is selling PC's.Trollop
@user3203132 : You would be really surprised to know that IE11 is amazing.. Just need users to totally phase out older versions... ;)..Apeak
your answer is still actual ? i need to know, that i can use this validator.Delacruz
@shutdown-hnow: Please use validator.w3.org as this is the official one. Ill update the answer accordingly. ThanksApeak
A
3

Here is Bootstrap’s explanation for their validation errors:

https://getbootstrap.com/docs/5.3/getting-started/browsers-devices/#validators

(replace 5.3 with your actual version of bootstrap if it's different)

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.

Aragats answered 16/8, 2016 at 13:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.