There are several ways to do this.
You can use div
with the gradient background. (I recommend)
Background: linear-gradient (Ângulo, cor comprimento, cor comprimento, cor comprimento)
Follow the example below.
* {margin:0;padding:0}
html, body {
height: 100%;
width: 100%;
}
body {
background-image: linear-gradient(
160deg,
blue 65%,
black 65%);
}
If you have trouble creating a gradient, simply use the link
You can also use two div
. Just use transformt: rotate(Ângulo)
and some values to change the length. (Do not recommend)
html,body, #container, .azul, .preto {
width:100%;
height: 100%
}
#container {
overflow:hidden;
}
.azul {
background: blue
}
.preto {
background: black;
transform: rotate(165deg);
margin-top: -157px;
margin-left: 20px;
width: 150%;
}
<div id="container">
<div class="azul"></div>
<div class="preto"></div>
</div>
Or you can use images.
background-image: url('Link da imagem');
background-size: cover; /* Informa para a imagem cobrir todo o elemento */
background-repeat: no-repeat /* Informa para não repetir a imagem. */
Example:
body {
background-image: url('https://i.stack.imgur.com/OoXOC.png');
background-size:cover;
background-repeat: no-repeat
}