How to make a curved edge hexagon by using CSS

前端 未结 5 1901
囚心锁ツ
囚心锁ツ 2020-11-27 22:46

This is my CSS.

CSS

#hexagon-circle { 
    width: 100px; 
    height: 55px; 
    background: red; 
    position: relative;
    borde         


        
5条回答
  •  抹茶落季
    2020-11-27 23:43

    I think you are looking for this.

    css

    .hex {
      position: relative;
      margin: 1em auto;
      width: 10em; height: 17.32em;
      border-radius: 1em/.5em;
      background: orange;
      transition: opacity .5s;
    }
    .hex:before, .hex:after {
      position: absolute;
      width: inherit; height: inherit;
      border-radius: inherit;
      background: inherit;
      content: '';
    }
    .hex:before {
       -webkit-transform: rotate(60deg);
       -ms-transform: rotate(60deg);/*Added for IE9*/
       transform: rotate(60deg);
    }
    .hex:after {
      -webkit-transform: rotate(-60deg);
      -ms-transform: rotate(-60deg);/*Added for IE9*/
      transform: rotate(-60deg);
    }
    

    fiddle

提交回复
热议问题