-1

I want to create image with the border in opposite corners (using :: after and :: before). I almost got it, BUT the image doesn't cover the whole space in the div. Below the image there is some empty space (marked red in jsfiddle), and I don't understand what is the reason. The most important thing is that the image's height change the width. Could you explain me what I did wrong? :)

This is my code: https://jsfiddle.net/ndy79hvo/1/

Johannes
  • 64,305
  • 18
  • 73
  • 130
sqtr
  • 199
  • 1
  • 3
  • 12

1 Answers1

1

This is due to the default baseline vertical alignment for images, which leaves some empty space below that baseline (where the descenders of letters like j, p, y would go). Add display: block; to the CSS rule for your image to change this.

https://jsfiddle.net/tpqzr3w2/

Johannes
  • 64,305
  • 18
  • 73
  • 130