网站首页 > PHP源码 > 文件数据 > css – 多个背景色图层

css – 多个背景色图层

  • 作者:互联网
  • 时间:2026-01-19 11:44:01
我想知道是否有可能为div创建两个背景颜色并覆盖它们.

我想要一个白色背景颜色,以便这个div下方的内容不会透过,另一个rgba()颜色涂在这个白色上,以便为每个脚本创建更亮的颜色.

如果不理解为什么要这样,可以使用纯色渐变来完成: fiddle.

body {    background: linear-gradient(rgba(220,14,120,0.5), rgba(220,14,120,0.5)),                linear-gradient(white, white); /* first bg is on top of this */}