Star

https://danielpietrasik.pl/css-formy-i-struktury/

by Daniel Pietrasik

HTML

<!-- 
 - CSS Formy i struktury tworzone za pomocą kodu
 - https://danielpietrasik.pl/css-formy-i-struktury/
-->

<div id="star"></div>

CSS

/**
 * CSS Formy i struktury tworzone za pomocą kodu
 * https://danielpietrasik.pl/css-formy-i-struktury/
 **/

#star {
   position: relative;
   color: #F34A53;
   width: 0px;
   border-right: 50px solid transparent;
   border-bottom: 35px  solid #F34A53;
   border-left: 50px solid transparent;
   transform: rotate(35deg);
   margin: 70px auto;
}

#star:before {
   position: absolute;
   content: '';
   width: 0;
   top: -22px;
   left: -32px;
   border-bottom: 35px solid #F34A53;
   border-left: 15px solid transparent;
   border-right: 15px solid transparent;
   transform: rotate(-35deg);
}

#star:after {
   position: absolute;
   content: '';
   width: 0px;
   top: 0;
   left: -50px;
   border-right: 50px solid transparent;
   border-bottom: 35px solid #F34A53;
   border-left: 50px solid transparent;
   transform: rotate(-70deg);
}