How to add 10px between images using CSS?

If we use box-sizing: border-box; then you can just apply borders to specific elements without breaking the layout. you could make the entire gallery 10px wider than the screen and have a 5px padding (that is for two images in a row). Alternatively you might have a padding around the images a have the left