在 Chrome 中使用 rgba 和 Color Blend 设置分层背景时属性值无效

Invalid Property Value when setting layered Background using rgba and Color Blend in Chrome

提问人:Gabriel Toy 提问时间:11/14/2023 最后编辑:Gabriel Toy 更新时间:11/14/2023 访问量:25

问:

我正在为CSS库制作一个材料,并制作了一个名为:.mica.base

.mica.base {
  background: rgba(243, 243, 243, 0.5) normal, rgba(243, 243, 243, 0.5) color, rgb(243, 243, 243) luminosity;
}

当我尝试在网页上使用它时,chrome 在行中抛出了错误,并说 .我尝试删除图层,将混合模式移动到不同的参数,并使用回退颜色,但没有任何效果。backgroundInvalid property value

.mica.base {
  background: rgba(243, 243, 243, 0.5) normal, rgba(243, 243, 243, 0.5) color, rgb(243, 243, 243) luminosity;
}

body {
  background: url("https://winui-3.gtoy118.repl.co/dist/img/img0.jpg");
  background-size: cover;
}
<div class="mica base">
  <div>Hello</div>
  <button id="button" class="winui-button undefined"><span><span class="icon"> </span>Segoe UI Icons</span></button>
  <div class="DisplayTextBlockStyle">Display</div>
  <div class="TitleLargeTextBlockStyle">Title Large</div>
  <div class="TitleTextBlockStyle">Title</div>
  <div class="SubtitleTextBlockStyle">Subtitle</div>
  <div class="BodyStrongBlockTextStyle">Body Strong</div>
  <div class="BodyTextBlockStyle">Body</div>
</div>

图像上方应该有一个半透明层。我从这个网站了解到背景分层:developer.mozilla.org/en-US/docs/Web/CSS/......包含有关分层背景以及 w3schools.com/css/css3_backgrounds.asp 的文档。

HTML CSS 背景

评论

0赞 Nazar Mammedov 11/14/2023
你能出示HTML代码吗
0赞 Temani Afif 11/14/2023
你在哪里读到你可以使用这样的语法?这确实是无效的,没有意义。
0赞 Gabriel Toy 11/14/2023
@NazarMammedov它只是一个带有类的 div。我知道 div 有类,因为为了在 Web 检查器中抛出错误,必须使用该类。mica base
0赞 Gabriel Toy 11/14/2023
@TemaniAfif developer.mozilla.org/en-US/docs/Web/CSS/ 包含有关分层背景的文档,以及 w3schools.com/css/css3_backgrounds.asp
0赞 Temani Afif 11/15/2023
我建议你实际阅读这些链接......从第一个开始,您可以使用速记 background 属性及其各个属性(background-color 除外)来执行此操作。

答: 暂无答案