0
In HTML and CSS is appearing a white space below the image, see the example, the error is this white space between the image and the black box
.div1{
width: auto;
height: auto;
display: block;
}
.div2{
width: 100%;
height: 40px;
display: block;
background-color: #000000;
}
<div class="div1">
<img src="https://i.stack.imgur.com/stNlx.jpg">
</div>
<div class="div2"></div>
How to solve?
Wow, you can put a margin-bottom: -4px; to solve initially...
– user78859
you can try this as well by placing this style in the div1... width: 100%; height: 195px; background-image: url(https://i.stack.Imgur.com/stNlx.jpg); background-position: center; background-repeat: no-repeat; background-size: 70% auto;
– user78859
@Robertcezar Insert an image using the tag
<img>
is completely different to insert it as background of an element. They are not equivalent solutions and therefore one does not replace the other.– Woss
@Andersoncarloswoss I’m aware friend, just a way in case he wants to explore... just forgot to say he should remove the tag <img> if use.
– user78859