CSS3 Webkit gradient support updated

A while ago, I wrote another article here about the CSS3 gradients. At that time, you saw the browser support, the advantages of using them and their syntax.

So, what’s new since then?
The CSS3 Webkit syntax, which was quite different than Mozilla at that time, has been updated!


Latest news

About a week ago, the WebKit dev team announced they were updating the CSS3 gradient support in the rendering engine.

The most important point of their announcement was the that they will bring the CSS3 Webkit syntax in line with Mozilla’s implementation. Pretty cool huh? Now, you will have less headache pain when you’ll use both rendering engines (Webkit and Gecko) gradients.

What about the old syntax?

Now, beside the old old -webkit-gradient value, nightly WebKit builds include support for -webkit-linear-gradient and -webkit-radial-gradient.

No need to worry about the old syntax, it will still be supported.

We’ll maintain support for -webkit-gradient for the foreseeable future for all the existing content out there that uses it.

Webkit team assurances

Linear gradients

background-image: -moz-linear-gradient(#81a8cb, #cde6f9); /* Firefox */
background-image: -webkit-gradient(linear,left bottom,left top,color-stop(0, #cde6f9),color-stop(1, #81a8cb)); /* Webkit */

Mozilla, Chrome and Safari CSS3 linear gradients.

Now

background-image: -moz-linear-gradient(#81a8cb, #cde6f9); /* Firefox */
background-image: -webkit-linear-gradient(#81a8cb, #cde6f9); /* Webkit */

Check out the above Webkit updated syntax

Radial gradients

background-image: -moz-radial-gradient(#cde6f9, #81a8cb); /* Firefox */
background-image: -webkit-gradient(radial, 50% 50%, 0, 50% 50%,400, from(#cde6f9), to(#81a8cb)); /* Webkit */

Mozilla, Chrome and Safari CSS3 radial gradients.

Now

background-image: -moz-radial-gradient(#cde6f9, #81a8cb); /* Firefox */
background-image: -webkit-radial-gradient(#cde6f9, #81a8cb);  /* Webkit */

Check out the above Webkit updated syntax

Pros

This syntax update has just pros, no cons! Why’s that?

  • Less complexity
  • No need to search for online CSS3 gradients generators anymore. Both syntax are similar now and you can make the translation easier.

Conclusion

Still not using CSS3 gradients for your website? What are you waiting for?

13 thoughts on “CSS3 Webkit gradient support updated

  1. Hi and thanks for this great informations that you are sharing with everibody.
    I have a question regarding bkg gradients: i followed steps indicated by you and it’s working great for IE and FF, but for Chrome i have a vertical-repeated bkg. (can be seened at webdesignoptimizare.ro/brasovulturistic). In css when height it’s 100% , gradient gets bigger, but not full height.
    You think about something?
    Thanks!

      • works like a charm…thanks a lot, you’re a css wizard!
        In Chrome i see better that the blocks under the crumb navigation are moved 1px to the left-or the header is 1px to the right, but i will digg in the css file…also it looks like the website needs equal height columns, also in css.
        Thanks again, you are doing a great job!

          • fixed wid a hidden:overflow in wrapper!
            as a a matter of fact, there is one more thing that requires your skills, maybe you will have a moment to take a look: in FF 3.6.13 the menu jumps down 1-2 rows (in 3.6.12 , IE, Ch looks fine). What can i try for this?
            Thank you very much!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>