Показать сообщение отдельно
  #3 (permalink)  
Старый 26.03.2022, 21:48
Аватар для voraa
Профессор
Отправить личное сообщение для voraa Посмотреть профиль Найти все сообщения от voraa
 
Регистрация: 03.02.2020
Сообщений: 2,709

А вообще это на одном CSS делается
<!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">
    <link rel="stylesheet" href="style.css">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        #cont {
			position: relative;
			display: flex;
			flex-direction: column;
            width: 100%;
            height: 100vh;
			overflow-y: scroll;
			scroll-snap-type: y mandatory;
        }
        section {
            position: relative;
            width: 100%;
            min-height: 100vh;
            font-size: 60px;
            color: #FFF;
            scroll-snap-align: start;
        }
        .one {
            background-color: tomato;
        }
        .two {
            background-color: gold;
        }
        .three {
            background-color: green;
        }
        .four {
            background-color: blue;
        }
    </style>
    <title>Document</title>
</head>
<body>
	<div id=cont>
    <section class="one">1111</section>
    <section class="two">2222</section>
    <section class="three">3333</section>
    <section class="four">4444</section>
    </div>
</body>
</html>
Ответить с цитированием