Eric B Eric B - 1 year ago 88
CSS Question

How to make a div same height as glyphicon contents?

In this simple example, the inner tag has height 14px, but the outer tag has height 20px. How can I make the container tag have the same height as its child? I tried setting the div to inline-block, but that didn't do anything.

<i class="glyphicon glyphicon-folder-close"></i>

Answer Source

this should do the trick

div > .glyphicon {
  display: block;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download