Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to allow the path elements in an svg element to overflow the container

I was writing an animation for my logo (here is the link to the codepen), you can see the code there as well, but I will post here as well.

So I targeted every path element and changed it's properties and everything works fine, except for the fact that since I use the "transform" to move the elements because they leave the container and are hidden.

This is the CSS for the SVG element

svg {
  width:400px;
  height:400px;
  margin-top:100px;
  margin-left:calc(50% - 200px);
  transform-style:preserve-3d;
  overflow:visible;
}

I tried adding a viewbox inline property to the svg tag but that didn't work either, what can I do? I want every path to be visible no matter where it is, is this possible?

Thank you in advance.

like image 284
Meers E. Chahine Avatar asked Oct 30 '25 13:10

Meers E. Chahine


1 Answers

The overflow: visible rule you added to CSS definition for svg should have worked.

The reason it didn't was because your SVG also had a <clipPath> that had the effect of hiding the overflow. When you get rid of that also, things behave as you wanted.

Demo codepen

To get rid of the clip, I deleted the <clipPath></clipPath> element, and the clip-path="url(#clipPath20)" reference from the <g>. Both of these are near the start of the document.

like image 200
Paul LeBeau Avatar answered Nov 02 '25 04:11

Paul LeBeau



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!