gpt4 book ai didi

html - css 剪辑路径替代

转载 作者:太空宇宙 更新时间:2023-11-03 19:37:56 24 4
gpt4 key购买 nike

我正在尝试为我的网站做一个横幅,有点不同。

我想要底部边框,看起来像“向下箭头”

是这样的:JS FIDDLE

.indexBanner {
background-image: url('/image/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>

但是目前我使用的是clip-path,Firefox和IE都不支持。而且你还可以看到“箭头形”边框有点乱。

我也尝试过 transform: skew,在这种情况下,结果更像是一种“聊天气泡”效果。

有没有办法做到这一点,因为我完全没有想法。

最佳答案

https://jsfiddle.net/glebkema/h18w341m/

.indexBanner {
background-image: url('http://nauci.se/Flipo/assets/images/study.jpg');
background-repeat: no-repeat;
background-attachment: fixed;
background-position: center;
background-size: cover;
background-color: #404040;
height: 500px;
position: relative;
overflow-x: hidden;
}
.indexBanner:after {
content: "";
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 0;
height: 0;
border-left: 50vw solid white;
border-right: 50vw solid white;
border-top: 15vw solid transparent;
}
<div class="indexBanner"> 
</div>

关于html - css 剪辑路径替代,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37763393/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com