WebKit blog: CSS3 linear gradient style syntax

Source: Internet
Author: User

Web page Production WEBJX article introduction: webkit update for CSS3 gradient style syntax.

Before, I in front of the observation published a " understanding of CSS3 linear gradient ", I believe many students have studied CSS3 gradient, most people will be entangled it, WebKit and Firefox syntax is very different AH. In fact, the syntax of Firefox can be more standardized than the standard of the same. Now that the good news is here, WebKit begins to optimize the syntax of the CSS3 gradient. I don't know why webkit used that type of writing that year (08).

The specific wording is better than the discussion, recently WebKit in its blog introduced the new style of the gradient , the new wording adopted the use of the English-language and Firefox syntax, that is, Split the-webkit-gradient into-webkit-linear-gradient and-webkit-radial-gradient.

Let's look directly at how the code is:

1
2
3
4
5
. selector{
Background:-moz-linear-gradient (left, white
					, Black
					);/*gradient for firefox*/
Background:-webkit-linear-gradient,
					/*new gradient for WebKit/
background:- Webkit-gradient (linear,
					0
					0,
					0
					100%, from (#white), to (#black));/*the old grandient for webkit*/
}

Of course, the radiation gradient is also optimized:

1
2
3
4
5
. selector{
background:-moz-radial-gradient (10%
					30%, white
					, Black
					);/*gradient for firefox*/
Background:-webkit-radial-gradient (10%
					30%
					)/*new gradient for WebKit *
Background:-webkit-gradient (Radial,
					0
					10%,
					0
					30%, from (#white), to (#black)); Grandient for webkit*/
}

Well, WebKit and Firefox can finally use the same gradient syntax, and of course, when they can get rid of the private prefix best-the best time is IE9 can also perfectly support the gradient t_t

It should be noted that the new gradient syntax is only deployed to the nightly build version of the WebKit, Safari and chrome are not really implemented, but the estimate is not far away ~



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.