0

I use an SVG (which include Gaussian blur filter) as the background of a div but the filter part, no part of the svg which overflows the original path seem. As in the picture:

enter image description here

How can I fix it?

My SVG code:

<svg viewBox="0 0 50 50" xmlns="http://www.w3.org/2000/svg">
<filter id="glow">
<feGaussianBlur stdDeviation="10"/>
</filter>
<path transform="translate(5 5)" d="M0 0 L15 20 L30 0" style="fill:transparent; stroke:white; stroke-width:3; stroke-linejoin: round; stroke-linecap: round" />
<path filter="url(#glow)"  transform="translate(5 5)" d="M0 0 L15 20 L30 0" style="fill:transparent; stroke:white; stroke-width:3; stroke-linejoin: round; stroke-linecap: round" />
</svg>

CSS Code:

 div::after {
            content:"";
            position:absolute;
            background-image: url(imgs/thic.svg);
            background-repeat: no-repeat;
            background-size: contain;
            background-position: center;
            height: 100%;
            right:20px;
            width:40px;
            top:0
        } 
4
  • It seems some parts are missing from your question. Could you please try to clarify it?
    – Kaiido
    Commented Aug 4, 2021 at 1:51
  • I want the blur effect to seem entirely but no part that overflows the side of the path seems, as in the picture I've shared in the question. I've also added the CSS code I wrote. @Kaiido
    – Enes Giray
    Commented Aug 4, 2021 at 2:04
  • So you want the blur effect to continue even after the end of the (pseudo)element's boundaries? You can't really do that, you'd have to make the element bigger than it is currently, and change your SVG's viewBox.
    – Kaiido
    Commented Aug 4, 2021 at 2:11
  • The stdDeviation value is too big. Try a smaller one like 2 for example. Also I would recomend a smaller viewBox like viewBox="0 0 40 30"
    – enxaneta
    Commented Aug 4, 2021 at 7:06

0

Browse other questions tagged or ask your own question.