Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I cut down on gradient errors?

I just tried validating a large css file and ended up with 89 errors! To save time I tried using a cross browser gradient generating tool at color zilla. These generated gradients ended up causing about 90% of my errors:

background: rgb(56,115,160); /* Old browsers */
background: -moz-linear-gradient(top,  rgba(56,115,160,1) 0%, rgba(55,107,147,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(56,115,160,1)), color-stop(100%,rgba(55,107,147,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top,  rgba(56,115,160,1) 0%,rgba(55,107,147,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top,  rgba(56,115,160,1) 0%,rgba(55,107,147,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top,  rgba(56,115,160,1) 0%,rgba(55,107,147,1) 100%); /* IE10+ */
background: linear-gradient(top,  rgba(56,115,160,1) 0%,rgba(55,107,147,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3873a0', endColorstr='#376b93',GradientType=0 ); /* IE6-9 */

My errors read:

391     #nav    Value Error : background Too many values or values are not recognized : -moz-linear-gradient(top,rgba(21,60,91,1 ) 0%,rgba(43,63,81,1 ) 100% )

392     #nav    Value Error : background Too many values or values are not recognized : -webkit-gradient(linear,left top,left bottom,color-stop(0%,rgba(21,60,91,1 ) ),color-stop(100%,rgba(43,63,81,1 ) ) )

393     #nav    Value Error : background Too many values or values are not recognized : -webkit-linear-gradient(top,rgba(21,60,91,1 ) 0%,rgba(43,63,81,1 ) 100% )

394     #nav    Value Error : background Too many values or values are not recognized : -o-linear-gradient(top,rgba(21,60,91,1 ) 0%,rgba(43,63,81,1 ) 100% )

395     #nav    Value Error : background Too many values or values are not recognized : -ms-linear-gradient(top,rgba(21,60,91,1 ) 0%,rgba(43,63,81,1 ) 100% )

396     #nav    Value Error : background Too many values or values are not recognized : linear-gradient(top,rgba(21,60,91,1 ) 0%,rgba(43,63,81,1 ) 100% )

397     #nav    attempt to find a semi-colon before the property name. add it

397     #nav    Property progid doesn't exist : DXImageTransform

397     #nav    Parse Error DXImageTransform.Microsoft.gradient( startColorstr='#153c5b', endColorstr='#2b3f51',GradientType=0 ); 

The gradients look great across all browsers. Should I be concerned about these errors? If so, what's my best option here?

like image 219
Scott Avatar asked Apr 28 '26 00:04

Scott


2 Answers

You shouldn't be worried about those errors. Because they're vendor-specific they won't validate. I'd suggest not checking for vendor-specific prefixes next time you validate.

like image 99
ayyp Avatar answered Apr 29 '26 18:04

ayyp


Don't expect your CSS to fully validate with a W3C validator. See http://na.isobar.com/standards/#_css_validation

like image 32
Andrew Kolesnikov Avatar answered Apr 29 '26 18:04

Andrew Kolesnikov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!