CSS内容渐变遮罩

本文由清尘发表于2018-01-22 21:12最后修改于2019-01-14属于HTML/CSS分类

遮罩到内容的容器绝对定位,加上渐变背景CSS

.cntmask {
	padding-top: 200px;
	position: absolute;
	bottom: 0;
	background: linear-gradient(180deg, hsla(0, 0%, 100%, 0), #fff);
}

.cntmask {background: linear-gradient(-180deg,rgba(255,255,255,0) 0%,#f5f5f5 70%);}