Box-shadow trimmed in CSS columns in Chrome

后端 未结 9 2266
难免孤独
难免孤独 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:05

    div#column-container {   
        /* Set 2 columns*/
        overflow: hidden;
        padding: 5px;
        display: block;
    
         /* insignificant */
        width: 50%;
    }
    
    div#column-container div {
        background-color: yellow;
        float: left;
        width: 40%;
        margin: 5%;
    
        /* set shadow for yellow elements */
        box-shadow: 0px 1px 3px #000;
        -webkit-box-shadow: 0px 0px 15px #000;
        -moz-box-shadow:    0px 0px 15px #000;
        box-shadow:         0px 0px 15px #000;
    
        /* Make sure that yellow div is not split between columns */
        display: block;
    
        /* the rest - not significant */
        height: 70px;
    }
    

    This will give you almost similar look.

    And the Fiddle is here.

    P.S.Alter the margin and width values by yourself to make the boxes closer as per your requirement.

提交回复
热议问题