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
With an svg, it is pretty simple :
svg {
display: block;
width: 100%;
height: 90px;
background: yellow;
}
Note that I used the preserveAspectRatio="none" attribute so that the shape can have 100% width and keep 90px height
And here with a monkey image :
div {
position: relative;
}
svg {
display: block;
width: 100%;
height: 90px;
background: yellow;
}
img {
height: 50px;
position: absolute;
top: 0; bottom: 0;
left: 0; right: 0;
margin: auto;
background: #fff;
border-radius: 50%;
padding: 10px;
}