title: How to adjust an stretchable ol and an absolute block inside a fixed container
body: <p>i have a parent container .secondary-nav-wrap having css</p>
  
  <pre><code>.secondary-nav-wrap {
      margin: 30px 0;
      position: relative;
  }
  </code></pre>
  
  <p>It contains an ol having variable li's and an absolute positioned div .import-26-as having css code </p>
  
  <pre><code>position: absolute;
  top: 0;
  right: 0;
  </code></pre>
  
  <p>Now when there are three li's everything is fine </p>
  
  <p><a href="https://i.stack.imgur.com/fk8fV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fk8fV.png" alt="enter image description here"></a></p>
  
  <p>but when number of li increases to 5 or 6 (max), the Import div is overlapped with the li i.e</p>
  
  <p><a href="https://i.stack.imgur.com/i29TH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/i29TH.png" alt="enter image description here"></a></p>
  
  <p>I am trying to achieve a design like this where yellow div automatically positions itself accordingly.</p>
  
  <p><a href="https://i.stack.imgur.com/3VDh9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3VDh9.png" alt="enter image description here"></a></p>
  
  <p>I am completely fine if yellow div overflows out of the parent div</p>
  
  <p>Edit:</p>
  
  <p>Code for li is </p>
  
  <pre><code>.primary-nav li, .secondary-nav li {
  float: left;
  text-align: center;
  list-style: none;
  max-width: 190px;
  }
  </code></pre>
  
  <p>Code for ol is </p>
  
  <pre><code>.primary-nav, .secondary-nav {
  display: inline-block;
  margin-right: auto!important;
  margin-left: auto!important;
  position: relative;
  margin-top: 0;
  margin-bottom: 0;
  }
  </code></pre>
  
  <p>CSS code for yellow div is </p>
  
  <pre><code>.import-26-as {
  position: absolute;
  top: 0;
  right: 0%;
  font-family: "Source Sans Pro",Helvetica,Arial;
  font-size: 12px;
  color: #4c4725;
  height: 34px;
  overflow: hidden;
  -moz-transition: height 150ms ease-out;
  -o-transition: height 150ms ease-out;
  -webkit-transition: height 150ms ease-out;
  transition: height 150ms ease-out;
  }
  </code></pre>
  
  <p>the parent div is wrapped inside a container div with css</p>
  
  <pre><code>.container {
  width: 950px;
  margin: 0 auto;
  }
  </code></pre>