clip-path

clip-path alternatives for Internet Explorer/Edge

心不动则不痛 提交于 2020-08-10 05:54:31
问题 I have a project that uses clip-paths to render a slant throughout the design. The scope of the project has changed and I now need to support IE/Edge, which do not support clip-paths. There is a common repeated design element where the clip-path is applied to an image/text component wrapper, and clips the bottom right corner (you can see this in the snippet below). I am not certain how to do this via other means so that it will work in IE/Edge. Is there another way of doing this that doesn't

How to resize SVG clip-path to be same size as image

旧时模样 提交于 2020-08-09 07:22:06
问题 I've got little problem resizing my svg clip-path to fit the image size. I've got code like this: <svg id="image-svg" class="clip"> <img class="main-img" src="http://25.media.tumblr.com/tumblr_m5nre6cxkQ1qbs7p5o1_r1_500.jpg" alt="" /> </svg> <svg class="clip"> <clipPath id="clipPolygon"> <polygon points="52 0,100 45,50 100,0 50"> </polygon> </clipPath> </svg> And then i'm using css like this: #image-svg { left:0; top:0; } .main-img { clip-path: url('#clipPolygon'); width:90%; } Everything

clip-path:circle() radius doesn't seem to be calculated correctly

喜欢而已 提交于 2020-08-05 05:31:48
问题 It's been bugging me for a while whenever I try to use the CSS circle() function to do some clipping as in: .red { width: 200px; height: 300px; background: red; border: 2px solid black; clip-path: circle(69%); /*barely cuts off the corners of the .red div */ } /* the full circle will enclose the entire box at around 71% or (sqrt(2)/2 * 100%) per Mozilla documentation and not at 100% as one might expect */ <div class='red'></div> the radius never seem to be calculated as I would expect it to.

Easiest way to convert polygon clip-path to Microsoft Edge supported “clippath” svg?

回眸只為那壹抹淺笑 提交于 2020-07-19 11:21:29
问题 For example, I have a css class with a polygon clip-path applied to it like so: .services-image-left { -webkit-clip-path: polygon(0 0, 97% 0, 83% 100%, 0% 100%); clip-path: polygon(0 0, 97% 0, 83% 100%, 0% 100%); } But I understand for this to work in Edge and IE I need to use the "clippath" property with svg points. Is there an easy way to convert the above polygon to an svg shape and apply it to everything with the .services-image-left class like the above sample? 回答1: The conversion is

How to resize ClipPath area of SVG?

淺唱寂寞╮ 提交于 2020-07-03 17:19:11
问题 I have such code: .img-container { width: 300px; height: 300px; background-color: lightgreen; overflow: hidden; } .clipped-img { clip-path: url('#header-clip-svg'); } <div class="img-container"> <!--clipping SVG--> <svg height="0" width="0"> <defs> <clipPath id="header-clip-svg"> <path d="M199.6,18.9c-4.3-8.9-12.5-16.4-22.3-17.8c-11.9-1.7-23.1,5.4-32.2,13.2c-9.1,7.8-17.8,16.8-29.3,20.3c-20.5,6.2-41.7-7.4-63.1-7.5C38.7,27,24.8,33,15.2,43.3c-35.5,38.2-0.1,99.4,40.6,116.2c32.8,13.6,72.1,5.9,100

Why does clip-path affect the stacking order (z-index) of elements later in DOM?

萝らか妹 提交于 2020-07-03 11:11:20
问题 This has been asked before, but only where z-index is explictly defined in the CSS. I am trying to use clip-path on a heading, but then pull up an image from within an element beneath this back over the top of that header. However, as soon as I define a clip-path on the header, the image (which should be higher up the stacking order as it appears later in the code) goes underneath the header : body { padding: 1em; } header { background: #a00; clip-path: polygon(0 0, 100% 0, 100% calc(100% -

Why does clip-path affect the stacking order (z-index) of elements later in DOM?

跟風遠走 提交于 2020-07-03 11:10:49
问题 This has been asked before, but only where z-index is explictly defined in the CSS. I am trying to use clip-path on a heading, but then pull up an image from within an element beneath this back over the top of that header. However, as soon as I define a clip-path on the header, the image (which should be higher up the stacking order as it appears later in the code) goes underneath the header : body { padding: 1em; } header { background: #a00; clip-path: polygon(0 0, 100% 0, 100% calc(100% -

Why does clip-path affect the stacking order (z-index) of elements later in DOM?

两盒软妹~` 提交于 2020-07-03 11:08:41
问题 This has been asked before, but only where z-index is explictly defined in the CSS. I am trying to use clip-path on a heading, but then pull up an image from within an element beneath this back over the top of that header. However, as soon as I define a clip-path on the header, the image (which should be higher up the stacking order as it appears later in the code) goes underneath the header : body { padding: 1em; } header { background: #a00; clip-path: polygon(0 0, 100% 0, 100% calc(100% -