-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcssbasic.html
53 lines (49 loc) · 1.21 KB
/
cssbasic.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
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
body {
min-height: 200vh;
}
.parent {
position: relative;
border: 1px solid black;
padding: 5px;
margin: 5px;
}
.child {
padding: .25rem;
}
.child-1 {
position: sticky;
left: 0px;
top: 0px;
background-color: lightblue;
}
.child-2 {
top: 0px;
right: 0px;
background-color: lightcoral;
}
.child-3 {
position: sticky;
background-color: lightgreen;
}
.child-4 {
background-color: lightsalmon;
}
</style>
</head>
<body>
<div class="parent parent-1">
<div class="child child-1">One</div>
<div class="child child-2">Two</div>
</div>
<div class="parent parent-2">
<div class="child child-3">Three</div>
<div class="child child-4">Four</div>
</div>
</body>
</html>