Cain Nuke
Cain Nuke

Reputation: 3079

clip-path polygon not working on chrome

Hi,

I have this SVG file:

<svg preserveAspectRatio="" viewBox="0 0 130 280" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" height="280px" width="130px">
 <clipPath id="search">
  <polygon points="8.96671,272.712 118.624,272.876 118.624,276.683 117.128,278.335 34.7667,278.417 33.1129,279.327 13.9283,279.327 9.29748,275.689 9.29748,272.546"/>
 </clipPath>
</svg>

My CSS code:

clip-path:url("file.svg#search");
-webkit-clip-path:url(file.svg#search);

the element is clipped on Firefox but not on Chrome. Why is that?

Thank you.

Upvotes: 0

Views: 1542

Answers (1)

Alireza
Alireza

Reputation: 1438

I added overflow: hidden add it works on chrome 55. here is my code:

<svg id="mySVG" height="0" width="0">
     <defs>
         <clipPath id="customPath">
         <path d="M36.531,-0.000 C36.531,-0.000 -16.969,6.500 5.531,76.000 C28.031,145.500 138.531,534.000 138.531,534.000 C138.531,534.000 150.031,583.000 220.531,576.000 C291.031,569.000 1033.531,501.000 1033.531,501.000 C1033.531,501.000 1094.531,504.000 1099.531,428.500 C1104.531,353.000 1099.531,1.000 1099.531,1.000 L36.531,-0.000 Z" />
     </clipPath>
 </defs>

.wrapper-mask {
   clip-path: url(#customPath);
   width: 1100px;
   overflow: hidden;
   height: 577px;
   transform: scale(0.97) perspective(1px);
}

Upvotes: 1

Related Questions