Search code examples
cssprogress-barbootstrap-modalz-index

progressbar in css inside modal bootstrap z-index issue


I have my progresbar written in css and line between first and second circle hovers a little the number "2". The lines beetwen circles are pseudelements.

This is the styles i used:

/* progressbar */
.progressbar {
  width: 100%;
  counter-reset: step;
  margin-top: 7px;
  padding: 0;
}

.progressbar li {
  list-style-type: none;
  float: left;
  width: 100px;
  position: relative;
  text-align: center;
  font-family: sans-serif;
  font-size: 15px;
  font-weight: normal;
  color: #546A79;
  /* Steps*/
}

.progressbar li:before {
  content: counter(step);
  counter-increment: step;
  width: 44px;
  height: 44px;
  line-height: 44px;
  /* border: 4px solid #fff; */
  display: block;
  text-align: center;
  margin: 0 auto 13px auto;
  border-radius: 50%;
  background-color: #E3E3E3;

  /* Circles*/
}

.progressbar li:after {
  content: '';
  position: absolute;
  width: 100%;
  height: 4px;
  background-color: #E3E3E3;
  /*lines */
  top: 20px;
  left: -50%;
  z-index: 0;
}

.progressbar li:first-child:after {
  content: none;
}

.progressbar li.active {
  color: #546A79;
}

.progressbar li.active:before {
  width: 48px;
  height: 48px;
  line-height: 48px;
  border-radius: 50%;
  border-color: #0073CF;
  color: black;
  background-color: #ffda47;
  margin: 0 auto 9px auto;

}

.progressbar li.active + li.active:after {
  background-color: #ffda47;
}

Here's jsfiddle of the problem:

http://jsfiddle.net/1aeur58f/523/


Solution

  • .progressbar li {
      list-style-type: none;
      float: left;
      width: 100px;
      position: relative;
      text-align: center;
      font-family: sans-serif;
      font-size: 15px;
      font-weight: normal;
      color: #546A79;
      z-index:1;
    }
    
    
    .progressbar li:after {
      content: '';
      position: absolute;
      width: 100%;
      height: 4px;
      background-color: #E3E3E3;
      /*lines */
      top: 20px;
      left: -50%;
      /*z-index: 0;*/
      z-index: -1;
    }