css 渐变色 css 背景颜色渐变色

/* chrome 2, safari 4; multiple color stops */
.bg {
		background-image: -webkit-gradient(
			linear,
			left,
			right,
			color-stop(0.32, #ffffff),
			color-stop(0.66, var(--color2))
		);
		/* chrome 10, safari 5.1 */
		background-image: -webkit-linear-gradient(90deg, #ffffff, #ff2929, #ffffff);
		/* firefox; multiple color stops */
		background-image: -moz-linear-gradient(90deg, #ffffff, #ff2929, #ffffff);
		/* ie10 */
		background-image: -ms-linear-gradient(
			90deg,
			#ffffff 0%,
			#ff2929 50%,
			#ffffff 100%
		);
		/* opera 11.1 */
		background-image: -o-linear-gradient(90deg, #ffffff, #ff2929, #ffffff);
		/* 标准写法 */
		background-image: linear-gradient(90deg, #ffffff, #ff2929, #ffffff);
}

效果:

posted @ 2022-05-13 11:43  柯宝宝智商感人  阅读(131)  评论(0编辑  收藏  举报