JSFiddle - React, Tailwind, and code Playground
by John Miltone
HTML
<nav id="navigation" class="clearfix">
<ul class="clearfix">
<li id="homeIcon"><a href=""></a></li>
<li><a href="">link 1</a></li>
<li><a href="">link 2</a></li>
<li><a href="">link 3</a></li>
<li><a href="">link 4</a></li>
<li><a href="">link 5</a></li>
</ul>
<a href="#" id="pull">Menu</a>
</nav>
CSS
/* ============= MAIN ====================== */
*
{
box-sizing: border-box;
-moz-box-sizing: border-box;
border: 0;
margin: 0;
padding: 0;
}
html
{
height: 100%;
}
body
{
height: 100%;
margin: 0;
padding: 0;
}
.clearfix:before, .clearfix:after
{
content: " ";
display: table;
}
.clearfix:after
{
clear: both;
}
#navigation
{
height: auto;
width: 100%;
background: #000000;
font-size: 1em;
font-family: 'PT Sans', Arial, sans-serif;
font-weight: bold;
position: relative;
}
#navigation ul
{
padding: 0;
margin: 0 auto;
width: 100%;
height: 40px;
}
#navigation li
{
display: block;
float: left;
width: 13.5%;
line-height: 40px;
}
#navigation a
{
color: #fff;
display: inline-block;
width: 100%;
text-align: center;
text-decoration: none;
line-height: 40px;
text-shadow: 1px 1px 0px #283744;
font-size: 1.2em;
}
#navigation li a
{
box-sizing:border-box;
}
#navigation li:last-child a
{
border-right: 0;
}
#navigation a:hover, nav a:active
{
background-color: #8c99a4;
}
#navigation a#pull
{
display: none;
}
#navigation li input
{
line-height: 40px;
margin: 5px;
width: 55%;
height: 20px;
}
#navigation li img
{
line-height: 40px;
margin: 5px;
}
/* ================ MEDIA QUERIES ================= */
@media only screen and (max-width: 980px)
{
#logo p
{
font-size: 1.8em;
}
#logo p span
{
font-size: 0.5em;
}
#navigation a
{
font-size: 0.9em;
}
}
@media only screen and (max-width: 750px)
{
#logo p
{
font-size: 1.5em;
}
#logo p span
{
font-size: 0.2em;
}
#navigation a
{
font-size: 0.7em;
text-align: center;
}
}
@media screen and (max-width: 600px)
{
nav
{
height: auto;
}
nav ul
{
display: block;
width: 100%;
height: auto;
...
JavaScript
var menu = $('nav ul');
$('#pull').on('click', function(e){
e.preventDefault();
menu.slideToggle("slow","linear");
});