.sidebar { position: fixed; top: 0; left: 0; z-index: 1; height: 100%; background-color: #fbefd5; overflow-x: hidden; width: 300px; padding: 12px; border-right: 1px solid #222222; font-size: 0.875rem; } @media only screen and (max-width: 600px) { .sidebar { top: initial; bottom: 0; left: 0; height: 45%; width: 100%; } } .close { position: absolute; top: 4px; right: 8px; font-size: 24px; margin-left: 12px; border: none; background: none; cursor: pointer; } .close:hover { color: #888888; }