Achieve the css slanted image shape --image included -
how effect using css , interested in slanted shape @ bottom of image( circled yellow on image above) ideas appreciated
there 2 ways, 1 has poor browser support , other not responsive design friendly.
here clip path approach:
#imagecontainer img:hover{ background:violet; -webkit-clip-path: polygon(12% 6%, 29% 14%, 71% 8%, 91% 29%, 44% 35%, 54% 64%, 10% 92%, 5% 43%); clip-path: polygon(12% 6%, 29% 14%, 71% 8%, 91% 29%, 84% 85%, 54% 64%, 10% 92%, 5% 43%); } #imagecontainer img { -webkit-clip-path: polygon(1% 3%, 3% 9%, 18% 21%, 54% 20%, 83% 63%, 66% 76%, 15% 83%, 25% 45%); clip-path: polygon(17% 13%, 33% 9%, 58% 21%, 84% 20%, 83% 63%, 66% 76%, 15% 83%, 25% 45%); -webkit-transition: -webkit-clip-path .6s ease-out; transition: -webkit-clip-path .6s ease-out; position:absolute; border-radius: 5px; width: 100%; height:270px; } keep in mind elements position must absolute or fixed, or clip path not work.
there "mask" property, has poorer browser support , issues, stay away now.
the other approach apply transform element, no solution imo.
link codepen, hover on container element.

Comments
Post a Comment