CSS double border (2 colors) without using outline?

前端 未结 7 980
小鲜肉
小鲜肉 2020-12-03 14:07

I was wondering what you guys think is the easiest way to get a double border with 2 colors around a div? I tried using border and outline together and it worked in Firefox

7条回答
  •  醉酒成梦
    2020-12-03 14:52

    A little trick ;)

    box-shadow: 
    0 0 0 2px #000,
    0 0 0 3px #000,
    0 0 0 9px #fff,
    0 0 0 10px #fff,
    0 0 0 16px #000,
    0 0 0 18px #000;
    

提交回复
热议问题