Quantcast
Channel: Inline element inside inline-block div - Stack Overflow
Viewing all articles
Browse latest Browse all 6

Answer by JoeL for Inline element inside inline-block div

$
0
0

You can fix this by either adding a float: left or vertical-align:top

https://jsfiddle.net/foxhh0av/

div > div {background: red;height: 200px;width: 19%;text-align: center;margin: 0 5% 5% 0;display: inline-block;  float: left;}img {height: 128px;width: 128px;display: /* "BLOCK" FIXES THE ISSUE */; }
<div id="wrapper"><div id="a1"><img src='http://dfsm9194vna0o.cloudfront.net/1471693-0-Washingmachineforlaundry128.png' alt=""/></div><div id="a2"></div><div id="a3"></div><div id="a4"></div><div id="a5"></div><div id="a6"></div><div id="a7"></div><div id="a8"></div></div>

Viewing all articles
Browse latest Browse all 6

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>