線形グラデーション
#linear-g {
background: gray;
background: linear-gradient(
/*方向あるいは角度を指定(省略可):下から上へ 例:to top right | 45deg は右上へ 初期値 to bottom = 180deg */
to top,
/*始点 2つ以上の複数の色値を指定(省略不可):glay(下)*/
gray 20%,
/*終点 white(上) 60% = 変更色の位置 */
white 60%
);
}
グラデーションが無効になった場合の色を指定しておくことが望ましい
example 1
#ex1 {
background: black;
background: linear-gradient(-135deg, #0ff 33%, #f0f 33%, #f0f 66%, #ff0 66%);
}