Back home

Animated Navigation Width CSS3

The Markup


						

CSS

nav{
	overflow: hidden;
}

nav ul { 
    float: left;
    left: 50%;
    position: relative;
}

nav ul,
nav ul li a span,
nav ul li a span:after { height: 80px }

nav ul li:first-child{
	border-left:1px solid #5a808b200;	
}

nav ul li {
	float: left;
	list-style: none;
    left: -50%;
    position: relative;
	border-right:1px solid #5a808b;
}

nav ul li:last-child { margin-right: 0 }

nav ul li a,
nav ul li a span { position: relative }

nav ul li a {
	padding: 80px 0 0;
	display: block;
	text-decoration: none;
}

nav ul li a span,
nav ul li a span:after {
	padding: 0 40px;
	font: 30px/80px 'Armata', sans-serif;
	display: block;
	left: 0;
	color: #fff;
}

nav ul li a span {
	top: 0;
	-webkit-transition: all 300ms cubic-bezier(.17,.83,.56,.99);
	   -moz-transition: all 300ms cubic-bezier(.17,.83,.56,.99);
		-ms-transition: all 300ms cubic-bezier(.17,.83,.56,.99);
		 -o-transition: all 300ms cubic-bezier(.17,.83,.56,.99);
			transition: all 300ms cubic-bezier(.17,.83,.56,.99);
}

nav ul li a span:after {
	content: attr(title);
	background:url(../../../../img/pattern.png) repeat #925280;
	position: absolute;
}

nav ul li a,
nav ul li a:hover span,
nav ul li.active a span { top: -80px }