VIDEO:
Source Code:
Images used:
HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<title>Parallax Website</title>
</head>
<body>
<div class="bg1">
<h1>Parallax</h1>
</div>
<div class="bg2">
</div>
<div class="bg3">
</div>
</body>
</html>
CSS:
*{
margin: 0;
padding: 0;
font-family: Century Gothic;
}
.bg1{
height: 100vh;
width: 100%;
background: url("photo1.jpg")no-repeat;
background-size: cover;
background-attachment: fixed;
}
.bg1 h1{
padding: 20px 50px;
background: black;
color: #ffffff;
font-size: 70px;
font-weight: 400;
font-style: italic;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
}
.bg2{
height: 100vh;
width: 100%;
background: url("photo2.jpg")no-repeat;
background-size: cover;
background-attachment: fixed;
}
.bg3{
height: 100vh;
width: 100%;
background: url("photo3.jpg")no-repeat;
background-size: cover;
background-attachment: fixed;
}
::-webkit-scrollbar{
display: none;
}
Comments
Post a Comment