So I am having a very simple markup like this.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<div class="foo">
<div>a</div>
</div>
</body>
</html>
and CSS:
.foo {
background-color: #eee;
height: 80px;
line-height: 80px;
display: inline;
vertical-align: middle;
}
But this makes div.foo to have 0 width and 0 height. If I set display to inline-block
, it works. Why?
Here is the JSBin of this post.