CSS Box-Shadow adds arbitrary white border to Div

前端 未结 3 1320
离开以前
离开以前 2021-01-14 18:56

I\'m adding a box shadow to an element containing an img and it\'s creating an arbitrary white border on the bottom of the element. No border is being applied via CSS (and I

相关标签:
3条回答
  • 2021-01-14 19:30

    Either :

    1. Add a display:block; to your img.
    2. Define a line-height of 0px on your div.

    An image is an inline element, so there is space for text, leaving that line.

    Demo

    0 讨论(0)
  • 2021-01-14 19:42

    And one more way to achieve this is to add virtical-align: top; to an img.

    0 讨论(0)
  • 2021-01-14 19:50

    try display block for image.

    .badge_image img {
        display: block;
    }
    
    0 讨论(0)
提交回复
热议问题