I want to make a triangle using css and i want to give a base according to the width of the parent section width i defined. Below are the id and class i used for it
.Workingon{
display: block;
background-color: rgb(23, 23, 36);
height: 500px;
width: 95%;
margin: auto;
position: relative;
overflow: hidden;
}
#UpTriangle{
width: 0;
height: 0;
position: absolute;
border-left: calc(100%-10px) solid transparent;
border-right: calc(100%-10px) solid transparent;
border-top:500px solid red;
}
Here below is html code.
<section class="Workingon">
<div id="UpTriangle">
</div>
</section>