R
R
rotFRONT12021-11-29 18:16:33
css
rotFRONT1, 2021-11-29 18:16:33

How to remove filter svg inheritance for child elements?

I'm trying to make "torn" edges of a block using filter svg. But it applies the same to all child elements.
Example: https://codepen.io/aleksandr2/pen/bGoGEbG

How to make text without this filter?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
RAX7, 2021-11-29
@rotFRONT1

.combined {
  position: relative;
  padding: 50px;
  width: 400px;
  z-index: 0;
}

.combined::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #ccc;
  border-radius: 7px;
  filter: url(#combined);
  z-index: -1;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question