I have am trying to format both a DIV and the image within it responsively.
Here is my CSS:
#masthead { width:100% ;
height:auto ;
max-height:350px ;
background:navy ;
text-align:center ;
overflow:hidden ;
}
#masthead img { width:100% ;
max-width:300px ;
height:auto ;
margin:0 auto ;
}
and my HTML:
<div id="masthead">
<img src="http://i.imgur.com/K9aZKGI.png" />
</div>
The image is 300px wide by 350px high - the same height as the DIV. So why does the DIV extend 3 or 4 px below the image?
Here is the Jsfiddle: http://jsfiddle.net/m9sqn7hh/1/
It's driving me nuts. Any help is appreciated :)
Best,
Cynthia