Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot get rid of a bizarre 2px space between my child image and parent div

Tags:

html

jquery

css

I have tried everything I know. I'm beginning to think it's being created by Tumblrs javascript. First, I do have inline blocks, which i know read white space and add pixels. But after much testing, stripping all my javascript, and removing everything and leaving just a standard

<div><img src="image"/></div>

I still get this 2px space below the image!

So I'm wondering is there a way to do this without jquery perhaps?

.parentdiv {
    height:100% - 2px;
}

?

like image 510
RGBK Avatar asked Nov 12 '11 16:11

RGBK


1 Answers

This issue is caused by the line-height, because text is expected, too.

Solution

line-height: 0;

Sample

http://jsfiddle.net/YGjpk/

like image 107
Smamatti Avatar answered Nov 16 '22 00:11

Smamatti