0
Would you like to understand why a spacing is created between the image and the div? How is it possible to see when adding the red background. And how to correct without using position
or margin
and padding
negative?
.box-img {
width: 100%;
max-width: 200px;
background-color: red;
// tentando remover padding
padding: 0 !important;
}
.box-img > img {
width: 100%;
height: 100%;
// tentando remover margin
margin: 0 !important;
}
<figure class="box-img">
<img src="http://img1.topimagens.com/ti/th/200x200/lobos/lobos_068.jpg" alt="">
</figure>
Remember also that there is no property called marging, to define the margins we use the property margin
– Ademílson F. Tonato
@Ademílson typing error! Thanks for fixing! ;)
– alan