<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="styles.css">
<title>Параллакс Эффект на CSS</title>
</head>
<body>
<div class="parallax"></div>
<div class="content">
<h1>Параллакс Эффект на CSS</h1>
<p>Прокрутите вниз, чтобы увидеть эффект.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla vitae elit libero, a pharetra augue.</p>
<p>...</p>
</div>
</body>
</html>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body, html {
height: 100%;
}
.parallax {
background-image: url("https://assets.codepen.io/1425525/tota_ill_1.jpg");
height: 100vh;
background-attachment: fixed;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
.content {
height: 200vh;
background-color: #f0f0f0;
text-align: center;
padding: 20px;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.