0

我想实现从深到浅或从浅到深的颜色组合如何实现,请检查 - http://screencast.com/t/zBgFPTOtp7 请帮助

4

2 回答 2

5

It's using CSS3 gradients. This can generate one for you http://www.colorzilla.com/gradient-editor/ Alternatively if you want to learn how to write them yourself I learnt how to do so here... http://www.w3schools.com/css3/css3_gradients.asp

Typical use it to say colour A to B. for a DIV with the class mydiv this would look like this (in your style.css file)

.mydiv{
background: linear-gradient(white, blue);
}
于 2013-10-14T11:58:29.177 回答
1
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='blue', endColorstr='white'); /* for IE */
background: -webkit-gradient(linear, left top, left bottom, from(blue), to(white)); /* for webkit browsers */
background: -moz-linear-gradient(top,  blue,  white); /* for firefox 3.6+ */

这提供了一个跨浏览器兼容的 CSS。注意上面的颜色是蓝色,下面是白色,你可以根据你的需要改变它。享受!

于 2013-10-14T12:12:11.243 回答