Creating a Fuzzy Border in CSS 3

后端 未结 7 1656
伪装坚强ぢ
伪装坚强ぢ 2021-02-05 16:15

Here\'s my source image:

\"enter

And my source image zoomed in:

7条回答
  •  情话喂你
    2021-02-05 16:29

    It's just using two box shadows, one inset and the other outset, i.e:

    .box {
      width: 100px;
      height: 100px;
      box-shadow: 0 3px 6px rgba(0,0,0,0.3), inset 0 -3px 3px rgba(0,0,0,0.1);
      border: solid #ccc 1px;
      border-radius: 10px;
      margin: 50px 0 0 50px;
    }
    

    See it here: http://jsfiddle.net/WYLJv/

提交回复
热议问题