multi colored border repeating possible with css?

前端 未结 8 995
攒了一身酷
攒了一身酷 2020-12-15 14:18

I\'ve searched and can only find multiple border issues. I need to make one border with 4 colors that repeat.

8条回答
  •  醉酒成梦
    2020-12-15 14:41

    No need for wrappers, multiple 'borders' are possible by using box-shadow

    Codepen Example

    #content {
      width:100px;
      height:100px;
      margin:25px;
      box-shadow:
      0 0 0 2px green,
      0 0 0 4px white, 
      0 0 0 6px blue,
      0 0 0 8px orange,
      0 0 0 10px green,
      0 0 0 12px red,
      0 0 0 14px blue;
      0 0 0 16px black;
    }
    

    I'm sure you could tweak to adjust.

提交回复
热议问题