Answer by Stickers for Inline element inside inline-block div
The default vertical-align value is baseline, it can be the bottom line of the text or the bottom line of an image (img element is a replaced element, inline* level), which causes the offset in the...
View ArticleAnswer by Daniel Semblano for Inline element inside inline-block div
The img tag behaves like a inline and bock element, basead on this answer: Is <img> element block level or inline level?That's why you have to display block on the img inside a div with...
View ArticleAnswer by Julian for Inline element inside inline-block div
You could set vertical-align: top; to your child divs (div > div).
View ArticleAnswer by JoeL for Inline element inside inline-block div
You can fix this by either adding a float: left or vertical-align:tophttps://jsfiddle.net/foxhh0av/div > div {background: red;height: 200px;width: 19%;text-align: center;margin: 0 5% 5% 0;display:...
View ArticleAnswer by Chris G for Inline element inside inline-block div
Just change this in your css:img { height: 128px; width: 128px; display: block; }That should fix it.
View ArticleInline element inside inline-block div
Can't get my head around on why <img> inside <div style="display: inline-block"> pushes that div lower from top?HTML<div id="wrapper"><div id="a1"><img src='...'...
View Article