-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpositioning_sticky
111 lines (86 loc) · 2.1 KB
/
positioning_sticky
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
/*this is HTML code in file named as index.html*/
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="outer">
<div id ="start"> A
</div>
<li class="inner">Alexa (Alix)</li>
<li class="inner">Anjali</li>
<li id="x" class="inner">Ali</li>
<li class="inner">Asmina</li>
<li id="y" class="inner">Arianna</li>
<li class="inner">Aamir</dli>
<li id="z" class="inner">Ankit</li>
<li class="inner">Ashish</li>
<li class="inner">Anmol</li>
</div>
<div class="outer1">
<div id ="end"> B
</div>
<li class="inner">Ball</li>
<li id="bat" class="inner">Bat</li>
<li class="inner">Base </li>
<li class="inner">Body</li>
<li class="inner">Boomerang</li>
<li class="inner">BOB</li>
<li class="inner">ballistic</li>
<li class="inner">bomb</li>
<li class="inner">Button</li>
<li class="inner">balloon</li>
<li class="inner">breeze</li>
<li class="inner">bombay</li>
<li class="inner">Brain</li>
</div>
</body>
</html>
/*this is CSS code in file named as style.css*/
.outer {
background-color: bisque;
margin: 30px;
border: solid brown 2px;
padding: 40px;
/* position: sticky;
top: 10px;
bottom: 10px; */
top: 0;
font: 40px "Crimson Text";
color: #fdef67;
background-color: dodgerblue;
}
.outer1 {
background-color: bisque;
margin: 30px;
border: solid brown 2px;
padding: 40px;
top: 0;
font: 40px "Crimson Text";
color: #fdef67;
background-color: dodgerblue;
}
.inner {
background-color: mediumvioletred;
margin: 20px;
height: 60px;
width: 400px;
border: solid white 2px;
padding: 10px;
color: white;
}
#start{
position: sticky;
top: 20px;
bottom: 20px;
}
#end{
position: sticky;
top: 20px;
bottom: 20px;
}