-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
Copy pathParralax.html
181 lines (152 loc) · 3.63 KB
/
Parralax.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Parallax Scrolling Example</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<nav>
<ul>
<li><a href="#home">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#services">Services</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</nav>
<!-- Parallax Section -->
<section class="parallax-section">
<div class="parallax-background"></div>
<div class="content">
<Br><br>
<h1>Parallax Scrolling Effect</h1>
<p>Scroll down to see the parallax effect in action!</p>
</div>
</section>
<!-- Other Content -->
<section class="regular-section">
<h2>Other Section</h2>
<p>This is a regular section of the page. Add more content here to make the page scrollable.</p>
</section>
<footer>
<p>Visit our other pages:</p>
<ul>
<li><a href="#page1">Page 1</a></li>
<li><a href="#page2">Page 2</a></li>
<li><a href="#page3">Page 3</a></li>
</ul>
</footer>
</body>
<style>
nav {
position: fixed;
top: 0;
width: 100%;
background-color: #333;
z-index: 100;
}
nav ul {
list-style-type: none;
padding: 10px;
text-align: center;
}
nav ul li {
display: inline;
margin: 0 15px;
}
nav ul li a {
color: white;
text-decoration: none;
font-size: 16px;
}
nav ul li a:hover {
text-decoration: underline;
}
/* General Reset */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: Arial, sans-serif;
line-height: 1.6;
}
/* Parallax Section */
.parallax-section {
position: relative;
height: 100vh;
/* Full viewport height */
overflow: hidden;
}
.parallax-background {
background-image: url(mountain-lake-forest-nature-scenery-4k-wallpaper-uhdpaper.com-135@[email protected]);
/* Replace with your image URL */
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-attachment: fixed;
background-size: cover;
background-position: center;
z-index: -1;
/* Send the background behind the content */
}
.content {
position: relative;
text-align: center;
color: white;
z-index: 1;
padding: 20px;
}
.content h1 {
font-size: 4rem;
}
.content p {
font-size: 1.5rem;
}
/* Regular Section */
.regular-section {
padding: 100px 20px;
background-color: #f4f4f4;
}
.regular-section h2 {
font-size: 2rem;
}
.regular-section p {
font-size: 1.25rem;
}
/* Responsive Design */
@media (max-width: 768px) {
.content h1 {
font-size: 2.5rem;
}
.content p {
font-size: 1.2rem;
}
}
footer {
background-color: #333;
color: white;
padding: 20px;
text-align: center;
}
footer ul {
list-style-type: none;
padding: 0;
}
footer ul li {
display: inline;
margin: 0 10px;
}
footer ul li a {
color: white;
text-decoration: none;
}
footer ul li a:hover {
text-decoration: underline;
}
</style>
</html>