.sidebar { position: fixed; top: 0; left: 0; z-index: 1; height: 100%; background-color: #f5f5f5; overflow-x: hidden; width: 300px; padding: 12px; border-right: 1px solid #222222; } .close { position: absolute; top: 4px; right: 8px; font-size: 24px; margin-left: 12px; border: none; background: none; cursor: pointer; } .close:hover { color: #888888; }