.topnav { background-color: #333; position: relative; height: 72px; padding-left: 16px; padding-top: 16px; @media screen and (max-width: 799px) { overflow: hidden; z-index: 100; height: initial; padding-left: initial; padding-top: initial; } nav { display: block; text-align: right; margin-right: 16px; @media screen and (max-width: 799px) { display: none; text-align: initial; margin-right: initial; } } a { color: white; text-decoration: none; font-size: 17px; @media screen and (max-width: 799px) { padding: 14px 16px; display: block; } &.icon { display: none; @media screen and (max-width: 799px) { display: block; position: absolute; right: 0; top: 0; } } &:hover { background-color: #ddd; color: black; } } }