【发布时间】:2018-10-15 18:55:34
【问题描述】:
我想要从一种颜色到另一种颜色的背景过渡,但是这会洗掉一些文本。有没有办法让文字自动适应背景?最好只使用 CSS?
我尝试使用另一个论坛的“mix-blend-mode:difference”解决方案,但这对文本没有任何影响。
.container{
color: white;
background-color: black;
background-image: linear-gradient(white, black);
width:100%;
margin:0px;
padding:0px;
}
body{
width:100%;
margin:0px;
}
【问题讨论】:
-
这些对我来说不是实用的解决方案。文字阴影使文字看起来很糟糕,而且我没有使用图像背景,所以我不能让背景变暗。渐变应该从默认的白色背景混合到较暗的颜色。
标签: css html background-color linear-gradients