【发布时间】:2019-01-26 06:26:12
【问题描述】:
我有一个项目使用剪辑路径在整个设计中呈现倾斜。项目范围发生了变化,我现在需要支持不支持剪辑路径的 IE/Edge。
有一个常见的重复设计元素,其中剪辑路径应用于图像/文本组件包装器,并剪辑右下角(您可以在下面的 sn-p 中看到这一点)。
我不确定如何通过其他方式执行此操作,以便它可以在 IE/Edge 中运行。是否有另一种方法可以做到这一点,而无需我必须导出已应用倾斜的图像?
.image-text-wrapper {
clip-path: polygon(0 0, 100% 0, 100% 75%, 0% 100%);
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
width: 600px;
background-color: aliceblue;
}
.image-text-wrapper .image {
width: 50%;
overflow: hidden;
}
.image-text-wrapper .text {
width: 50%;
text-align: center;
}
<div class="image-text-wrapper">
<div class="image">
<img src="https://img.purch.com/rc/640x415/aHR0cDovL3d3dy5zcGFjZS5jb20vaW1hZ2VzL2kvMDAwLzA4Mi8yMzEvb3JpZ2luYWwvbTMzLmpwZw==" />
</div>
<div class="text">
Content is here
</div>
</div>
【问题讨论】:
-
答案取决于您确切需要什么形状以及您需要支持哪些版本的 IE。通常,您可能会使用 SVG。
标签: css internet-explorer microsoft-edge clip-path