【发布时间】:2018-06-22 16:16:20
【问题描述】:
.parent-div {
background-image: url(path\to\image);
background-size: cover;
}
.text-div {
/* make text transparent but not this background */
background-color: orange;
}
<div class="parent-div">
<div class="text-div">Welcome!</div>
</div>
我想让 text-div 的文本透明,以便我可以看到 parent-div 的背景。 text-div 的其余部分必须是不透明的。
基本上我想要这个效果:
【问题讨论】:
-
我希望我的文字是透明的而不是背景