【问题标题】:Is it possible to layer multiple background images in CSS [duplicate]是否可以在 CSS 中分层多个背景图像 [重复]
【发布时间】:2021-09-22 14:19:29
【问题描述】:

对于 DIV 块,我可以使用具有不同背景位置的多个背景图像 PNG 吗?是否可以仅使用 CSS 和 HTML

【问题讨论】:

标签: css


【解决方案1】:

这是你要问的吗?

div {
  height: 320px;
  
  background-image:
    url(https://pngimg.com/uploads/elmo/elmo_PNG90481.png),
    url(https://previews.123rf.com/images/kateph/kateph1803/kateph180300025/97623211-white-clouds-on-the-blue-sky-sky-texture.jpg);
  background-position: center, left top;
  background-size: 320px, 100vw;
  background-repeat: no-repeat, repeat;
}
<div>
  <p>This div has multiple background layers</p>
</div>

正如 BeerusDev 所说,您可以阅读更多关于 here 的信息。

【讨论】:

  • 完美,这就是我想要的,谢谢
猜你喜欢
  • 1970-01-01
  • 2011-12-24
  • 1970-01-01
  • 2015-11-11
  • 2021-12-07
  • 1970-01-01
  • 1970-01-01
  • 2011-02-03
  • 1970-01-01
相关资源
最近更新 更多