2-1 用 box-shadow 来模拟外框

2.多重边框 - 图1

  1. .box{
  2. width: 100px;
  3. height: 100px;
  4. background: yellowgreen;
  5. box-shadow: 0 0 0 10px orangered,
  6. 0 0 0 15px turquoise,
  7. 0 2px 5px 15px rgba(0,0,0,.6);
  8. margin:20px auto;
  9. }

2-2 outline 方案

2.多重边框 - 图2

   .box{
        margin: 20px auto;
        width: 200px;
        height: 100px;
        background: yellowgreen;
        border: 10px solid #655;
        outline: 2px dotted red;
        outline-offset: -10px;
    }

 outline-offset          --控制它跟元素边缘之间的间距   接受负值