<div class="normal"></div>
<div class="demo"></div>
<div class="triangle"></div>
xxxxxxxxxx
html, body {
width: 100%;
height: 100%;
display: flex;
}
div {
width: 100px;
height: 100px;
margin: auto;
}
.normal {
border: 1px solid #000;
background: deeppink;
}
.demo {
border: 1px solid #000;
background: deeppink;
clip-path: polygon(0 0, 100% 0, 0 100%, 0 0);
}
.triangle {
background: deeppink;
clip-path: polygon(0 0, 100% 0, 0 100%, 0 0);
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.