我想为我的网站做一个横幅,有点不同。css剪辑路径替代
我想下边框,是一种 “向下箭头” 寻找
事情是这样的:JS FIDDLE
.indexBanner {
background-image: url('https://i.stack.imgur.com/dFUnt.jpg');
background-repeat: no-repeat;
background-attachment: fixed;
background-position: center;
background-size: cover;
background-color: #404040;
height: 500px;
position: relative;
-webkit-clip-path: polygon(50% 0%, 100% 0, 100% 85%, 50% 100%, 0 85%, 0 0);
}
<div class="indexBanner"></div>
但目前我使用的夹路径,这不支持Firefox和IE。 而且你可以看到“箭头形”的边框有点混乱。
我也试过transform: skew
在这种情况下,结果更多的是“聊天泡泡”效果。
有没有办法做到这一点,因为我都没有想法。
您可以使用本答案中提到的'skew'方法 - http://stackoverflow.com/questions/30368404/how-to-create-a-polygon-shape-div/30370429#30370429。我不明白你的意思是“聊天泡泡”效应。也许如果你演示一个演示,我可以帮助微调它。 SVG将是你最好的选择。 – Harry
检查[this](https://jsfiddle.net/alireza_safian/qkvz8z1j/10/) – Alex
只是注意到,Firefox已经支持'clip-path'参考SVG''元素的年龄和基本形状像大约一年的“多边形”(没有前缀)。它需要''about:config'中的'layout.css.clip-path-shapes.enabled'标志设置为'true'。 –
Ana