0

From what I've seen it's possible for a parent element's width to be the same as it's child if you display it as inline-block, but is there a way to have the parent element have the same height?

  <div id="nav-logo">
     <img src="site_logo.png" alt="Site Logo" />
  </div>

-

   #nav-logo {
  display: inline-block;
  float: left;
  width: 236px; 
  padding-right: 15px;
  padding-left: 15px;
  position: relative;
  top: -5px;
   }
  • Seems like your code would produce a div that has the same height as the image. https://jsfiddle.net/j08691/du4wx0by/ – j08691 Jul 24 '17 at 16:35

1 Answers1

0

Setting the inline image to display:block does the trick.