@media only screen and (min-width: 1000px) { header { z-index: 1; position: absolute; top: 0px; width: 100%; } } @media only screen and (max-width: 500px) { .nav li { margin-left: 2px !important; margin-right: 2px !important; width: 20vw; } } @media only screen and (min-width: 501px) and (max-width: 999px) { .nav li { margin-left: 2px !important; margin-right: 2px !important; width: 100px; } }