Box-shadow trimmed in CSS columns in Chrome

后端 未结 9 2286
难免孤独
难免孤独 2020-12-15 17:38

I want the block elements inside CSS columns to have box shadow. The following, simplified code renders as expected in IE10 and Firefox 21, but in current C

9条回答
  •  忘掉有多难
    2020-12-15 18:16

    Had similar issues with a 3 column layout. Chrome cut the box-shadow but only on top in column 2 and 3...

    box-shadow cut

    Margin Workaround:

    .item {
      box-shadow: 0px 0px 15px #000;
      display: inline-block;
      margin-top: 15px; /* same as box-shadow blur */     
      width: 100%;
    }
    .container{
      column-count: 3;
      column-gap: 30px;
      margin-top: -15px;/* negative value same as box-shadow blur & item margin-top */
    }
    

提交回复
热议问题