Jump to content

White gap between images


Recommended Posts

Hello Guys,

Any one able to explain why there is this magic white gap between the images?

I've spent whole day on trying to get rid of this...maybe some one can help?


<!DOCTYPE html>

<img src="main.jpg">
<img src="main.jpg">






Link to comment
Share on other sites

Images are inline elements, so they are aligned with the baseline of the text. There is space below the text baseline to accommodate hanging letters such as g or y. To solve this, you can use the vertical-align CSS property on the images to align them with the middle of the text instead of the baseline.

This would go in your CSS stylesheet

img {
  vertical-align: middle;


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...