Simple CSS-only breadcrumb

Simple and neutral breacrumb, created without image, using the "CSS arrows" technique.

by Jens Grochtdreis

HTML

<p id="breadcrumb">
    <a href="#">Home</a>
    <a href="#">Grandpa</a>
    <a href="#">Father</a>
    <a href="#">Son</a>
    Product
</p

SCSS

$linkColorHover: #00b0ec;
$gray: #F0F0F0;
$gray2: #aaa;

body {
    padding: 40px;
    font-family: Helvetica, sans-serif;
    font-size: 13px;
}

#breadcrumb {
    margin-bottom: 20px;
    line-height: 30px;
    color: $gray2;
    padding: 1px;
    border: 1px solid $gray;
    
    a {
        display: block;
        float: left;
        background: $gray;
        padding-right: 10px;
        height: 30px;
        margin-right: 31px;
        position: relative;
        text-decoration: none;
        color: $gray2;
        
        &:last-of-type {
            margin-right: 25px;
        }
        
        &:before {
            content: "";
            display: block;
            width: 0;
            height: 0;
            position: absolute;
            top: 0;
            left: -30px;
            border: 15px solid transparent;
            border-color: $gray;
            border-left-color: transparent;
        }
        
        &:after {
            content: "";
            display: block;
            width: 0;
            height: 0;
            position: absolute;
            top: 0;
            right: -30px;
            border: 15px solid transparent;
            border-left-color: $gray;
        }
        
        &:first-of-type {
            padding-left: 15px;
            
            &:before {
                display: none;
            }
        }
        
        &:hover {
            background: $linkColorHover;
            color: #fff;
            text-decoration: none;
            
            &:before {
                border-color: $linkColorHover;
                border-left-color: transparent;
            }
            
            &:after {
                border-left-color: $linkColorHover;
            }
        }
    }
}