html: place img vertically without space between

html, image

Solution

Adding the css property `display:block` should do the trick. I also removed padding and margins to eliminate any other styling. All styling should be moved to a CSS bock instead of inline.

img {
  padding: 0;
  margin: 0;
  display: block;
}
<div>
  <img border="0" src="https://dummyimage.com/200x100/1ff/100">
</div>
<div>
  <img border="0" src="https://dummyimage.com/200x100/100/1ff">
</div>

Problem

I am placing images right after each other vertically. I want them to be smushed up against each other, but I'm getting a blank line between them. How do I get rid of this line? I've tried margin=0px. I've also tried not putting them in a div. (The image below is from the W3 editor) ``` <div> <img border="0" src="/images/pulpit.jpg" width="304" height="228" style = "margin:0px;"> </div> <div> <img border="0" src="/images/pulpit.jpg" width="304" height="228" style = "margin:0px;"> </div> ```

Original source