Css3渐变
CSS3 渐变(gradient)可以让你在两个或多个指定的颜色之间显示平稳的过渡。 以前,你必须使用图像来实现这些效果,现在通过使用 CSS3 的渐变(gradients)即可实现。此外,渐变效果的元素在放大时看起来效果更好,因为渐变(gradient)是由浏览器生成的。 1、线性渐变 语法: background: linear-gradient(direction, color-stop1, color-stop2, …); direction:默认为to bottom,即从上向下的渐变;使用角度渐变 stop:颜色的分布位置,默认均匀分布,例如有3个颜色,各个颜色的stop均为33.33%。 2、径向渐变 径向渐变不同于线性渐变,线性渐变是从“一个方向”向“另一个方向”的颜色渐变,而径向渐变是从“一个点”向四周的颜色渐变 语法: background: radial-gradient(center, shape, size, start-color, …, last-color);