JSFiddle - React, Tailwind, and code Playground
HTML
<!DOCTYPE html>
<body>
<div class="navigation">
<ul>
<li><a href="#">Winterhalder</a></li>
<li><a href="#">Me</a></li>
<li><a href="#">Service</a></li>
<li><a href="#">Contact</a></li>
<li class="account"><a href="#">Account</a></li>
</ul>
<a href="#" class="pull">Navigation</a>
</div>
</body>
</html>
CSS
/* NAVIGATION */
.navigation
{
width: 100%;
height: 50px;
background: #34495E;
position: fixed;
top: 0;
}
.navigation ul
{
width: 960px;
height: 50px;
margin: 0px auto;
padding: 0px;
}
.navigation li
{
display: inline;
float: left;
}
.account{
float: right !important;
}
.navigation a
{
font: 400 14px Open Sans;
color: #FFF;
width: 140px;
line-height: 50px;
text-align: center;
display: inline-block;
}
.navigation a:hover, .navigation a:active
{
color: #1abc9c;
}
.navigation a.pull
{
display: none;
}
/* RESPONSIVE */
@media screen and (max-width: 960px)
{
.navigation
{
height: auto;
}
.navigation ul
{
width: 100%;
display: block;
height: auto;
}
}
@media screen and (max-width: 560px)
{
.navigation
{
height: auto;
}
.navigation ul
{
display: none;
}
.navigation li
{
display: block;
float: none;
width: 100%;
}
.navigation a.pull
{
display: block;
background-color: #2C3E50;
width: 100%;
position: relative;
}
.navigation a.pull:after
{
display: inline-block;
}
.navigation a
{
text-align: left;
width: 100%;
text-indent: 25px;
}
}
JavaScript
$(function() {
var pull = $('.pull');
menu = $('.navigation ul');
menuHeight = menu.height();
$(pull).on('click', function(e) {
e.preventDefault();
menu.slideToggle();
});
$(window).resize(function(){
var w = $(window).width();
if(w > 480 && menu.is(':hidden')) {
menu.removeAttr('style');
}
});
});