.image-slider { position: relative; width: 100%; max-width: 800px; margin: 0 auto; } .image-slider img { width: 100%; height: auto; display: block; } .slider { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 10px; height: 100%; background-color: #fff; cursor: ew-resize; z-index: 10; } .image-slider:hover .slider { width: 30px; } .image-slider:hover img { filter: grayscale(100%); } .image-slider:hover img:last-of-type { filter: grayscale(0); }