-1

I'm trying to fit the buttons and the image inside the navbar div. What ends up happening is that the buttons end up within the <div>, but the image extends way beyond the <div>:

enter image description here

@import url(https://fonts.googleapis.com/css?family=Roboto);

#navbar {
  border-bottom: solid;
  border-color: gray;
  border-width: 1%;
  height: 6%;
  background: black;
  padding: 0.25%;
}
ul {
  list-style-type: none;
}
li {
  display: inline-block;
  margin: 1%;
  margin-top: 0%; !important
}
#logo {
  width: auto;
}
.link-buttons {
  float: right;
}
<html>

  <!-- navigation bar -->
  <div id="navbar">
    <ul>
      <!--  nav bar buttons -->
      <li id="logo"><span><img id="logo" src="logo-transparent.gif"/></span></li>
      <li class="link-buttons"><button>Join the team!</button></li>
      <li class="link-buttons"><button>Attend a class!</button></li>
      <li class="link-buttons"><button>Contact Us!</button></li>
    </ul>
  </div>

  <!-- content -->
  <div id="container">
  </div>
</html>
Sebastian Brosch
  • 42,106
  • 15
  • 72
  • 87
Human Cyborg Relations
  • 1,202
  • 5
  • 27
  • 52
  • provided your js fiddle. thx – Fiido93 Apr 22 '16 at 07:52
  • check out this link: [http://stackoverflow.com/questions/4394309/how-do-i-fit-an-image-img-inside-a-div-and-keep-the-aspect-ratio](http://stackoverflow.com/questions/4394309/how-do-i-fit-an-image-img-inside-a-div-and-keep-the-aspect-ratio) – Farhad Apr 22 '16 at 07:54
  • I think you need to mention a width and height to your logo...can you please provide a jsfiddle as Fiido said. – satya Apr 22 '16 at 07:54
  • Do not use same id for multiple elements. "Id"s are mean to be used one per page.
  • May be you should set a fixed height for the image. Set width: auto; height: 32px; change the value to what ever you want. – Sree Apr 22 '16 at 07:58