<main ontouchstart>
	<nav class="tab-input">
		<input id="tab-radio-home" name="tab-radio" type="radio"/>
		<input id="tab-radio-shop" name="tab-radio" type="radio"/>
		<input id="tab-radio-blog" name="tab-radio" type="radio"/>
		<input id="tab-radio-about" name="tab-radio" type="radio"/>
		<input id="tab-radio-contact" name="tab-radio" type="radio"/>
		<label for="tab-radio-home" id="tab-radio-label-home">home</label>
		<label for="tab-radio-shop" id="tab-radio-label-shop">shop</label>
		<label for="tab-radio-blog" id="tab-radio-label-blog">blog</label>
		<label for="tab-radio-about" id="tab-radio-label-about">about</label>
		<label for="tab-radio-contact" id="tab-radio-label-contact">contact</label>
		<hr/>
	</nav>
</main>
$p: 12px;
$n: 5;

// container
.tab-input {
	display: flex;
	position: relative;
	background: white;
	border-radius: 2px;
	// border
	hr {
		position: absolute;
		bottom: 0;
		left: 0;
		margin: 0;
		border: 0;
		border-radius: 2px;
		height: $p/3;
		width: calc(100% / #{$n});
		background: lighten($slate, 50%);
	}
	// text for the radio inputs
	label {
		display: block;
		width: calc(100% / #{$n});
		padding: $p*2;
		text-align: center;
		text-transform: capitalize;
	}
	// radio inputs
	input {
		cursor: pointer;
		opacity: 0;
		appearance: none;
		display: block;
		position: absolute;
		top: 0;
		left: 0;
		margin: 0;
		width: calc(100% / #{$n});
		height: 100%;
		z-index: 2;
    &:hover {
				~ hr {
					background: mix(lighten($slate, 50%), $blue, 75%);
					transition: transform 250ms cubic-bezier(0,.5,.5,1.1), background 250ms ease-out;
				}
			}
			&:active {
				~ hr {
					background: $blue;
					transition: all 250ms ease-out;
				}
			}
    
		// loop for positioning inputs over labels
		@for $i from 1 through $n {
			&:nth-of-type(#{$i}) {
				left: calc(100% / #{$n} * #{$i - 1});
        &:checked {
						~ hr {
							transform: translateX(#{($i - 1) * 100%});
						}
					}
        &:hover, &:focus, &:active {
						~ hr, ~ input:checked ~ hr {
							transform: translateX(#{($i - 1) * 100%});
						}
					}
			}
		}
	}
}

// additional styling
body {
	display: flex;
	flex-flow: row wrap;
	align-items: center;
	align-content: center;
	justify-content: center;
}

main {
	width: 100%;
	max-width: 800px;
	padding: $p/2;
	background: lighten($slate, 75%);
	@media only screen and (min-width: 800px) {
		border-radius: 2px;
	}
}

External CSS

  1. https://codepen.io/tutsplus/pen/598c614630b8b6882828b40d33bdbf3a
  2. https://fonts.googleapis.com/css?family=Libre+Franklin:100,200,300,400,500,600`

External JavaScript

This Pen doesn't use any external JavaScript resources.