TL DR: (solution)
The easiest way to invert this pentagon is to invert the borders that are used to create it, as in the following snippet:
#pentagon {
margin: 0px 0 5px 20px;
position: relative;
width: 110px;
border-width: 0px 36px 100px;
border-style: solid;
border-color: #abefcd transparent;
}
#pentagon:before {
content: "";
position: absolute;
height: 0;
width: 0;
top: 100px;
left: -36px;
border-width: 70px 90px 0px;
border-style: solid;
border-color: #abefcd transparent transparent;
}
<div id="pentagon"></div>
Run codeHide result
How is a pentagon shape created?
The pentagon shape that you showed in the question is created as follows:
border-top 100px, #abefcd, border-left border-right 36px, . , .border-bottom 70px, #abefcd, border-left border-right 90px, . , , .
. , .
#pentagon {
margin:70px 0 5px 20px;
position: relative;
width: 110px;
border-width: 100px 36px 0;
border-style: solid;
border-color: red transparent;
}
#pentagon:before {
content: "";
position: absolute;
height: 0;
width: 0;
top: -170px;
left: -36px;
border-width: 0 90px 70px;
border-style: solid;
border-color: transparent transparent blue;
}
<div id='pentagon'></div>
Hide result
?
, , .
- , , .
border-bottom 100px #abefcd. border-top 0px. border-top , 0px. border-top 70px #abefcd. border-bottom 0px. .top , () ( 100px).