Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Two floating divs side by side, same height (follow up)

Tags:

html

css

My previous question was answered here: Two floating divs side by side, same height

My problem: Someone supplied an example here: http://jsfiddle.net/s7ufg/18/

How can I remove the extra space below the image?

like image 496
user1040259 Avatar asked Feb 19 '23 02:02

user1040259


2 Answers

Add vertical-align:top to your img rule:

img {
    max-width: 100%;
    height: auto;
    width: auto;   
    vertical-align:top;
}
​

jsFiddle example

like image 121
j08691 Avatar answered Mar 08 '23 13:03

j08691


display:block; to the image solve it

img {
    display:block;
    max-width: 100%;
    height: auto;
    width: auto;   
}

jsFiddle example

like image 45
NullPoiиteя Avatar answered Mar 08 '23 15:03

NullPoiиteя