html - 如何在不同的浏览器中使用形状(多边形)?

标签 html css browser shapes

我正在我的网站上使用 CSS 来制作形状。 它在 chrome 中运行良好,但在 mozilla、internet explorer 中打开时,它无法运行。

有人知道怎么解决吗?

这是 fiddle

http://fiddle.jshell.net/dm3qe27o/2/

<div class="index-main-wrapper">
    <div class="home-left-shape"></div>
    <div class="home-right-shape"></div>
    <div style="clear:both;"></div>
</div>

.home-left-shape {
height:100vh;
width:50vw;
float:left;
background-color:#bfb6a5;
background-size:cover;
-webkit-shape-outside: polygon(0% 0%, 0% 0%, 100% 100%, 0% 100%);
shape-outside: polygon(0% 0%, 0% 0%, 100% 100%, 0% 100%);
-webkit-clip-path: polygon(0% 0%, 0% 0%, 100% 100%, 0% 100%);
-webkit-shape-margin: 20px;
}
.home-right-shape {
height:100vh;
width:50vw;
float:right;
background-color:#bfb6a5;
background-size:cover;
-webkit-shape-outside: polygon(0% 100%, 100% 0%, 100% 100%, 0% 100%);
shape-outside: polygon(0% 100%, 100% 0%, 100% 100%, 0% 100%);
-webkit-clip-path: polygon(0% 100%, 100% 0%, 100% 100%, 0% 100%);
-webkit-shape-margin: 20px;
}

最佳答案

使用不同的浏览器

-webkit-shape-outside: polygon(0% 0%, 0% 0%, 100% 100%, 0% 100%); -mozila & chrom

-moz-shape-outside: polygon(0% 0%, 0% 0%, 100% 100%, 0% 100%); - mozila

-o-shape-outside: polygon(0% 0%, 0% 0%, 100% 100%, 0% 100%); - 歌剧

-ms-shape-outside: polygon(0% 0%, 0% 0%, 100% 100%, 0% 100%); - Internet Exploler

关于html - 如何在不同的浏览器中使用形状(多边形)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31911238/

相关文章:

css - 为什么我不能针对智能手机而不是采用响应式设计的智能手机

node.js - 动态编译 CoffeeScript CommonJS 模块

java - Java applet使用智能卡实现数字签名

403 Forbidden 错误时的浏览器行为

jquery : Get html content between child and end of its parent

css - Div 破坏了我的 CSS 菜单

html - 无法更改导航栏的背景颜色

html - 使用 Bootstrap 在一行中输入框和标签

html - 如何隐藏iframe src链接

php - wordpress视频调整大小