I am trying to create a diagonal line on a webpage, to act as a section/section break. This is essentially a split colour section. I cant use an image as if the page gets en
You can use CSS3 clip:
.yellow {
width: 100%;
height: 90px;
background: yellow;
-webkit-clip-path: polygon(100% 0, 0 0, 0 100%);
clip-path: polygon(100% 0, 0 0, 0 100%);
}
.black {
width: 100%;
height: 90px;
background: black;
-webkit-clip-path: polygon(100% 0, 0 100%, 100% 99%);
clip-path: polygon(100% 0, 0 100%, 100% 99%);
margin-top: -90px;
}
Demo: http://jsfiddle.net/zLkrfeev/2/
It's not widely supported by the browsers: http://caniuse.com/#feat=css-clip-path