Here is my HTML code:
<div>
<span style="display: inline-block;height:20px">20</span>
<span style="display: inline-block;"><img src="img/ex.png"/></span>
</div>
The image I have in the second span is sized at 15x15 pixels
Upon inspecting with Chrome, I noticed that the first image has a height of 15 and the second span has a height of 21. (the first one should have been 20 as expected)
I'm puzzled as to why the second span has a height of 21 instead of 15.
Any insights on this would be greatly appreciated. Thank you!
Below is the code snippet:
<!DOCTYPE html>
<html>
<head>
<style>
<!-- CSS reset starts here -->
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
</style>
</head>
<body>
<div>
<span style="display: inline-block;height:20px">20</span>
<span style="display: inline-block;"><img src="img/ex.png"/></span>
</div>
</body>
</html>