M
M
Michael R.2018-02-12 22:17:15
css
Michael R., 2018-02-12 22:17:15

How to cut out a piece from a background that is given a color?

Hello!
There is a first block with bg-image. A layer above is the next-second block, but with already bg in the form of #fff, i.e. the first block with the #fff background overlaps the second block with the bg-image.
Is it possible to cut out part of the background of the second block so that we can see the image of the first block through this `hole`?
Screenshot:
5a81e80ac9fcf285789951.jpeg
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Aleksey Solovyev, 2018-02-12
@Mike_Ro

clip and clip-path properties (it will be easier to prepare a mask and cut it out)
https://www.sarasoueidan.com/blog/css-svg-clipping/

<svg>
  <defs>
    <clipPath id="clipping">
      <polygon points="98.4999978 153.75..."/> // ваша маска
    </clipPath>
  </defs>
</svg>

.item {
  clip-path: url(#clipping);
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question