Check out this working demo of breadcrumbs in action on JSFIDDLE
Below is the code snippet:
HTML
<div id="crumbs">
<ul>
<li><a href="#1">One</a></li>
<li><a href="#2">Two</a></li>
</ul>
</div>
CSS
#crumbs ul li {
display: inline;
}
#crumbs ul li a {
display: block;
float: left;
height: 50px;
background: #3498db;
text-align: center;
padding: 30px 40px 0;
position: relative;
margin: 0 10px 0 0;
font-size: 20px;
text-decoration: none;
color: #fff;
padding: 30px 40px 0 80px;
}
#crumbs ul li a:after {
content: "";
border-top: 40px solid rgba(0,0,0,0);
border-bottom: 40px solid rgba(0,0,0,0);
border-left: 40px solid #3498DB;
position: absolute;
right: -40px;
top: 0;
z-index: 1;
}
#crumbs ul li a:before {
content: "";
border-top: 40px solid rgba(0,0,0,0);
border-bottom: 40px solid rgba(0,0,0,0);
border-left: 40px solid #fff;
position: absolute;
left: 0;
top: 0;
}
#crumbs ul li a:hover {
background: #fa5ba5;
}
#crumbs ul li a:hover:after {
border-left-color: #fa5ba5;
}
The CSS currently changes color when hovered over, but I want to make it so that the color remains after clicking on a breadcrumb item. This will help users see which tab is active. I've tried using :active in CSS, but it doesn't preserve the color after click.
Any suggestions?