Search code examples
htmlcsstwitter-bootstrapbreadcrumbs

Bootstrap Split Progress Bars


I can't for the life of me figure out the best way to do this. I've tried using progress bars, using individual divs, nothing seems to work. I found examples on the web attempting to do this but to no avail.

Here's what i'm trying to accomplish:

enter image description here

Here's what I have:

enter image description here

I seem to be headed in the right direction but can't figure it out. I'd like to accomplish this strictly with CSS if possible. Any help is greatly appreciated.

#breadcrumbs-two{
  overflow: hidden;
  list-style: none;
  float: right;
  padding: 0;
}

#breadcrumbs-two li{
  float: left;
  margin: 0 .5em 0 1em;
}

#breadcrumbs-two a{
  background: #ddd;
  padding: .7em 1em;
  float: left;
  text-decoration: none;
  color: #444;
  text-shadow: 0 1px 0 rgba(255,255,255,.5);
  position: relative;
}

#breadcrumbs-two a:hover{
  background: #99db76;
}

#breadcrumbs-two a::before{
  content: "";
  position: absolute;
  top: 50%;
  margin-top: -1.5em;
  border-width: 1.5em 0 1.5em 1em;
  border-style: solid;
  border-color: #ddd #ddd #ddd transparent;
  left: -1em;
}

#breadcrumbs-two a:hover::before{
  border-color: #99db76 #99db76 #99db76 transparent;
}

#breadcrumbs-two a::after{
  content: "";
  position: absolute;
  top: 50%;
  margin-top: -1.5em;
  border-top: 1.5em solid transparent;
  border-bottom: 1.5em solid transparent;
  border-left: 1em solid #ddd;
  right: -1em;
}

#breadcrumbs-two a:hover::after{
  border-left-color: #99db76;
}

#breadcrumbs-two .current,
#breadcrumbs-two .current:hover{
  font-weight: bold;
  background: none;
}

#breadcrumbs-two .current::after,
#breadcrumbs-two .current::before{
  content: normal;
}
<ul id="breadcrumbs-two">
												    <li><a href="">Lorem ipsum</a></li>
												    <li><a href="">Vivamus nisi eros</a></li>
												    <li><a href="">Nulla sed lorem risus</a></li>
												    <li><a href="" class="current">Current crumb</a></li>
												</ul>


Solution

  • I have achieved with using bootstrap breadcrumb. I hope this will be helpful. If you need any further assistance reply with comment.

    nav .breadcrumb {
        padding: 0;
        background: transparent;
    }
    
    .breadcrumb .breadcrumb-item a {
        position: absolute;
        left: 0;
        right: 0;
        top: 18px;
        font-size: 13px;
        color: #999 !important;
        z-index: 1;
        text-decoration: none;
    }
    
    .breadcrumb .breadcrumb-item {
        position: relative;
        margin: 0 15px 0 0;
        background: #575763;
        min-width: 100px;
        height: 16px;
    }
    
    .breadcrumb-item:before {
        content: "" !important;
        position: absolute;
        width: 0;
        border-top: 16px solid #575763;
        border-left: 10px solid transparent;
        left: -10px;
        top: 0;
        height: 16px;
    }
    
    .breadcrumb-item:after {
        content: "" !important;
        position: absolute;
        width: 0;
        border-top: 16px solid transparent;
        border-left: 10px solid #575763;
        right: -10px;
        top: 0;
        height: 16px;
    }
    
    .breadcrumb .breadcrumb-item:first-child {
        border-top-left-radius: 30px;
        border-bottom-left-radius: 30px;
    }
    
    .breadcrumb .breadcrumb-item:last-child {
        border-top-right-radius: 30px;
        border-bottom-right-radius: 30px;
    }
    
    .breadcrumb .breadcrumb-item:last-child:after {
        border-left: 15px solid transparent;
    }
    
    .breadcrumb .breadcrumb-item.active:first-child:before {
        border-top: 16px solid transparent;
    }
    
    .breadcrumb .breadcrumb-item.active {
        background: #61c988;
    }
    
    .breadcrumb-item.active:before {
        border-top: 16px solid #61c988;
    }
    
    .breadcrumb-item.active:after {
        border-left: 10px solid #61c988;
    }
    <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet"/>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>
    <nav aria-label="breadcrumb">
        <ol class="breadcrumb my-2">
            <li class="breadcrumb-item active"><a href="#">New</a></li>
            <li class="breadcrumb-item active"><a href="#">In-Review</a></li>
            <li class="breadcrumb-item"><a>Interview</a></li>
            <li class="breadcrumb-item"><a>Offered</a></li>
        </ol>
    </nav>