Why can't I use background image and color together?

前端 未结 10 2401
一生所求
一生所求 2020-12-04 07:33

What I am trying to do is to show both background-color and background-image, so that half of my div will cover the right shadow backg

10条回答
  •  执念已碎
    2020-12-04 08:13

    Here's an example of using background-image and background-color together:

    .box {
      background-image: repeating-linear-gradient( -45deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, .2) 15px, transparent 15px, transparent 30px);
      width: 100px;
      height: 100px;
      margin: 10px 0 0 10px;
      display: inline-block;
    }

提交回复
热议问题