How do I make a CSS triangle with smooth edges?

后端 未结 8 697
再見小時候
再見小時候 2020-12-13 13:56

I have a triangle (JSFiddle) using this CSS:

.triangle {
    width: 0;
    height: 0;
    border-top: 0;
    border-bottom: 30px solid #666699;
    border-le         


        
8条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-13 14:30

    None of the others worked for me, but I found the following did (by accident):

    .triangle {
      border: 1.3rem dashed #666699;
      border-right: .5rem solid rgba(255, 255, 255, 0);
    }
    

    The mixture of dashed/solid and the rgba fix worked in FF31, IE11, and Chrome36.

提交回复
热议问题