CSS triangle custom border color

后端 未结 5 1006
情话喂你
情话喂你 2020-11-22 13:28

Attempting to use a custom hex color for my css triangle (border). However since it uses border properties I am unsure how to go about doing this. I would like to steer clea

5条回答
  •  臣服心动
    2020-11-22 13:44

    I think this is a simpler one using clip-path:

    .container {
      width: 150px;
      min-height: 150px;
      background: #ccc;
      padding: 8px;
      padding-right: 6%;
      display: inline-block;
      clip-path: polygon(0% 0%,0% 100%,90% 100%,90% 5%,100% 10%,90% 15%,90% 0%);
    }
    test content

提交回复
热议问题