Linear-gradient and compatibility with browsers

1

I'm using the following background css in a menu:

background: -webkit-linear-gradient(left, #0260a9, #444); /* For Safari 5.1 to 6.0 */
background: -o-linear-gradient(left, #0260a9, #444); /* For Opera 11.1 to 12.0 */
background: -moz-linear-gradient(left, #0260a9, #444); /* For Firefox 3.6 to 15 */
background: linear-gradient(left, #0260a9, #444); /* Standard syntax */  

However, in browsers (like IE) that it does not work, the menu runs out of background. I wonder if it is possible to add an optional color if the browser does not understand this property, as if it were a default color, background. I know I have two options: make the property compatible with all or add that second solid color option. How to act?

    
asked by anonymous 22.12.2015 / 14:01

1 answer

3

For old browsers, you only have to define a background solid, without the gradient, like this:

background: #444; //ou outra cor que você queira
background: -webkit-linear-gradient(left, #0260a9, #444);
background: -moz-linear-gradient(left, #0260a9, #444);
background: -o-linear-gradient(left, #0260a9, #444);
background: linear-gradient(to right, #0260a9, #444);

But it all depends on the specifications and audience you will attain. In my work, I rarely worry about legacy browsers, since my clients always work with more modern things, so 'going back' and worrying about those 'fixes' is not viable for my case.     

22.12.2015 / 14:35