Beispiel:Scroll-Snap-1.html

Aus SELFHTML-Wiki
Wechseln zu: Navigation, Suche

<!doctype html> <html lang="de"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="./Beispiel:Grundlayout.css"> <title>Bilder-Galerie - 1</title> <style> .gallery { width: 90%;

   display: flex;
   margin: 2em auto;
   padding: 0 1em;

list-style-type: none;

   background: skyblue;
   overflow-y: hidden;
   scroll-snap-type: x mandatory;
   scrollbar-color: steelblue gold;
   scrollbar-width: auto;

img {

   margin: 1em;

padding: 1em; border-radius:0.5em; width: 30em; aspect-ratio: 4/3;

   scroll-snap-align: center;

} }

   ::-webkit-scrollbar { width: 14px;}
   ::-webkit-scrollbar-thumb { background-color: steelblue; border-radius: 14px; border: 3px solid gold;}
   ::-webkit-scrollbar-track { background: gold;}

</style> </head>

<body>

Bilder-Galerie mit scroll-snap ohne JS

</body> </html>