When i add a element and reference what is supposed to be inside of it trough CSS a stupid white outline appears. Heres the code:
<div class="button"><img src="your-image-url.jpg"></div>
<style>
body {
background-color: red;
margin: 100px;
}
.button {
padding: 0; /* Add this to remove padding /
margin: 0; / Add this to remove margin */
}
img {
width: 256px;
height: 256px;
}
</style>
I have tried:
outline: none
border: none
box-shadow: none
nothing worked…
2
Answers
Check that this white stripe is not contained in the image itself, because everything works as it should for me.
In your code, the
.button
class might have amargin
because of a typo in the comment. Besides that,<img>
are notorious for beingdisplay:inline
and having a default margin in browsers. So try to set the imagedisplay: block