<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Document</title> <style> html,body{ overflow: hidden; } .wrap { height: 40px; width: 500px; border: 1px solid; margin: auto; position: absolute; top: 0; right: 0; bottom: 0; left: 0; overflow: hidden; } .fl{ height: 100%; width: 2000px; background-color: pink; background: repeating-linear-gradient(37deg,black 0px,black 10px,white 10px,white 20px); transition: 20s; } .fl:hover{ margin-left: -1500px; } </style> </head> <body> <div class="wrap"> <div class="fl"></div> </div> </body> </html>