How to Move Dropdown Menu Directly Under Parent Tab?

I have a menu that has a nice dropdown and everything, but the only problem I have here is that I can’t find a way to move this damn drop down just a little bit to the left so it is directly under its parent tab!! It is always to the side, I see other people’s examples and when I add padding between the menu tabs it does the same exact thing! Perhaps it is because of that padding?? (I’m talking about this: http://jsbin.com/gimilapiki/edit?html,css,output)

So, here is my project: https://codepen.io/anon/pen/gxdVdO?editors=1100

Here’s some code (because StackOverFlow forces me to):

  body {background-color: #E8E8E8;}

ul {list-style: none;}

li {
  float: left;
  background-color: white;
}

li:not(.search) {padding: 12px 20px 12px 20px;}

li ul {
  display: none;
  position: absolute;
  padding-left: 1px;
  padding-top: 12px;
}

a {
  text-decoration: none;
  color: #5E5E5E;
}

li:not(.search):hover {
    color: black;
    background-color:#E3E3E3;;
}

ul li ul li {
  float: none;
  background-color: #E3E3E3;
}

ul li ul li:not(.search):hover {background-color: #D1D1D1;}
li:hover > ul {
  z-index: 289; 
  display: block;
  padding: 0 10px 20 20px;
}

.search-input {
      width: 150px;
      height: 18px;
      padding: 0 7px;
      border: 1px solid grey;
      border-radius: 10px;
      border-bottom-right-radius: 0px;
      border-top-right-radius: 0px;
    }

    .search-input:hover {
      outline: none;
      opacity:0.99;
      cursor: pointer;
      box-shadow: 0 2px 5px 2px rgba(0, 0, 0, 0.05) inset; 
    }
    input:focus {outline: none;}
    #search-icon {
      height: 18px;
    }
    .search {
        padding-bottom: 10px;
    }

    form {
      margin-top: 4px;
    }

I’m seriously stuck on this simple problem. Adding padding-left or padding-right or margins did nothing, it only affected the vertical height of the tabs and nothing else. I tried everything, researched as much as I can, and nothing worked. Please help!!!



ul > li{
  position: relative;
}
ul > li > ul{
  position: absolute;
  top: 100%;
  left: 0px;
}

try to add this.

you can add something simple like this

li ul {
      display: none;
      position: absolute;
      padding-left: 1px;
      margin-left: -10px;
      padding-top: 12px;
    }

i added the margin-left: -10px; and i think it works

Just add position as relative.That will solve your problem.