How to create a triangular shape with curved border?

前端 未结 2 1303
不知归路
不知归路 2020-12-06 23:19

I want to do this shape using CSS not as an image can I but I get the green shape and I can\'t get the all background transparent !

#arrowbox:before {
             


        
2条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-06 23:57

    my best (for the moment...)

    .corn6 {
      border-top: 1px solid darkblue;
      border-bottom: 1px solid darkblue;
      width: 200px;
      height: 28px;
      line-height: 28px;
      text-align: center;
      position: relative;
      margin-left: 30px;
    }
    .corn6::before,
    .corn6::after {
      display: block;
      position: absolute;
      top:0;
      width: 20px;
      height: 20px;
      border-top: 1px solid darkblue;
      border-right: 1px solid darkblue;
      content:'';
    }
    .corn6::before {
      left: 4px;
      transform: translateX(-50%) rotate(225deg) translateY(-5px) 
    } 
    .corn6::after {
      right: -4px;
      transform: translateX(50%) rotate(45deg) translateY(5px) 
    } 
    text

提交回复
热议问题