My friends and family are under attack in Ukraine.
Donate to protect them directly or help international organizations.

Div Higher Than the Image it Contains

August 2nd, 2012

I came across this simple problem when placing a sole image inside a div: the div always ended up being a few pixels higher than the image. Notice the few blank pixels below the image. After some searching, the solution was applied using CSS:

img { display: block; }

Previous: How to Improve Open Source Software’s Documentation Next: Security Questions: Not So Secure