.main { height: 100%; right: 0; left: 6%; position: absolute; z-index: 1; background: linear-gradient(to top, var(--secondary-color), var(--primary-color)) fixed; } .tab-home { height: 100%; width: 3%; float: left; position: relative; z-index: 0; background: var(--home); } .tab-yes { height: 100%; width: 3%; float: left; position: relative; z-index: -1; background: var(--yes); } .tab-home:hover ~ .main { left: 9%; transition: 0.2s; } .tab-home:hover { width: 6%; transition: 0.2s; } .tab-yes:hover ~ .main { left: 9%; transition: 0.2s; } .tab-yes:hover { width: 6%; transition: 0.2s; } .post { background: white; border-radius: 14px; padding: 1rem; margin: 1rem; width: 20%; }