gpt4 book ai didi

html - 如何使 div 的底部像这张图片一样尖

转载 作者:太空宇宙 更新时间:2023-11-03 21:08:31 25 4
gpt4 key购买 nike

我正在努力使我的背景图像的形状像下面所附的图像一样。

html:

<div id="hero-banner">

</div>

scss:

div#hero-banner {
margin-top: -60px;
max-height: 600px;
height: 60vh;
min-width: 100%;
background: url('http://finedininglovers.cdn.crosscast-system.com/ImageAlbum/6830/original_001.jpg') no-repeat, linear-gradient(rgba(0,0,0,0.5),rgba(0,0,0,0.5));
background: url('http://finedininglovers.cdn.crosscast-system.com/ImageAlbum/6830/original_001.jpg') no-repeat, webkit-linear-gradient(rgba(0,0,0,0.5),rgba(0,0,0,0.5));
background: url('http://finedininglovers.cdn.crosscast-system.com/ImageAlbum/6830/original_001.jpg') no-repeat, moz-linear-gradient(rgba(0,0,0,0.5),rgba(0,0,0,0.5));
background-blend-mode: overlay;
background-size: cover;
}

喜欢下面这张图

enter image description here

最佳答案

您可以使用 clip-path将元素剪裁成所需的形状。 This tool摆弄以获得您想要的确切形状真是太棒了。

div#hero-banner {
margin-top: -60px;
max-height: 600px;
height: 60vh;
min-width: 100%;
background: url('http://finedininglovers.cdn.crosscast-system.com/ImageAlbum/6830/original_001.jpg') no-repeat, linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5));
background: url('http://finedininglovers.cdn.crosscast-system.com/ImageAlbum/6830/original_001.jpg') no-repeat, webkit-linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5));
background: url('http://finedininglovers.cdn.crosscast-system.com/ImageAlbum/6830/original_001.jpg') no-repeat, moz-linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5));
background-blend-mode: overlay;
background-size: cover;
-webkit-clip-path: polygon(0 0, 100% 0, 100% 90%, 18% 100%, 0 90%);
clip-path: polygon(0 0, 100% 0, 100% 90%, 18% 100%, 0 90%);
}
<div id="hero-banner">

</div>

关于html - 如何使 div 的底部像这张图片一样尖,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49603288/

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