2
我正在寻找添加对角边框到div元素底部的最佳方法。最好以这样的方式来响应地工作。将对角边框添加到div元素的底部/顶部?
黑暗的部分是我的网站的标题和白色部分是其中的内容将开始。所以对角线就像一个分离器。
我做了一个小例子,但它不是真正的工作尚未: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;
}
对于你的情况,你可以利用倾斜的线性渐变作为背景的。看看这个线程,它会帮助你 - http://stackoverflow.com/questions/30317427/three-colors-angled-background-color/30317703#30317703 – Harry
你也可以看看这个线程(http: //stackoverflow.com/questions/30441122/shape-with-a-slanted-side-responsive)为各种方法来创建有反应的有角度的方面。它做了一半,而你不得不做另一面。 – Harry
@哈利谢谢你的回答! – colin