gpt4 book ai didi

html - 在 div 元素的底部/顶部添加对 Angular 线边框?

转载 作者:太空宇宙 更新时间:2023-11-04 16:15:51 25 4
gpt4 key购买 nike

我正在寻找将对 Angular 线边框添加到 div 元素底部的最佳方法。最好以某种方式进行响应。

这张图片是我希望它看起来如何的一个例子: enter image description here

黑色部分是我网站的标题,白色部分是内容开始的地方。所以对 Angular 线将起到分隔符的作用。

我做了一个小例子,但它还没有真正起作用:http://jsfiddle.net/ckknu2tr/

我正在使用 2 个不同的带边框的 div,一个用于左侧,一个用于右侧,代码示例:

.borderright {
line-height: 0%;
width: 0;
border-top: 50px solid transparent;
border-right: 400px solid white;
position: absolute;
bottom: 0;
right: 0;
}

最佳答案

您可以为此使用 SVG。下面是一个简短的示例,可能可以简化,我很少使用 SVG,也不是很精通。

body {
background-image: url(http://i.imgur.com/XxGffrU.jpg);
background-size: cover;
background-position: center bottom;
margin: 0;
}
#your_div {
position: relative;
top: 100px;
margin-top: 100px;
width: 100%;
height: 100px;
background: white;
}
#back {
position: relative;
top: -99px;
width: 100%;
height: 100px;
}
<div id="your_div">
<svg id="back" viewBox="0 0 100 10" preserveAspectRatio="none">
<path d="M 0,4 L 45,8 50,5 55,8 100,4 100,10 0,10 z" style="fill: white;"></path>
<path d="M 0,0 L 45,8 55,8 100,0 100,10 0,10 z" style="fill: rgba(255,255,255,0.5)"></path>
</svg>
</div>

关于html - 在 div 元素的底部/顶部添加对 Angular 线边框?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32023613/

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