126 lines
1.7 KiB
CSS
126 lines
1.7 KiB
CSS
body {
|
|
display: grid;
|
|
grid-gap: 30px;
|
|
grid-template-columns: repeat(4, 1fr);
|
|
}
|
|
|
|
.sticky-container {
|
|
box-shadow: 0 1px 1px 0 rgba(66, 66, 66, 0.08), 0 1px 3px 1px rgba(66, 66, 66, 0.16);
|
|
}
|
|
|
|
.content {
|
|
position: relative;
|
|
background-color: #fff;
|
|
padding: 25px;
|
|
}
|
|
|
|
.sticky-item {
|
|
position: sticky;
|
|
top: 0;
|
|
bottom: 0;
|
|
background-color: #fff;
|
|
}
|
|
.sticky-item img {
|
|
max-width: 100%;
|
|
}
|
|
|
|
.case-1 .content:first-child {
|
|
z-index: 2;
|
|
}
|
|
.case-1 .sticky-item {
|
|
z-index: 1;
|
|
}
|
|
.case-1 .content {
|
|
background-color: #56bcf9;
|
|
}
|
|
|
|
.case-2 .sticky-item {
|
|
z-index: 2;
|
|
}
|
|
.case-2 .content {
|
|
background-color: #47cf73;
|
|
}
|
|
|
|
.case-3 .content {
|
|
z-index: 2;
|
|
background-color: #b9f;
|
|
}
|
|
.case-3 .sticky-item {
|
|
z-index: 1;
|
|
}
|
|
|
|
.case-4 .content {
|
|
background-color: #ffdd40;
|
|
}
|
|
|
|
* {
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
html {
|
|
font-family: roboto;
|
|
}
|
|
|
|
body {
|
|
margin: 30px;
|
|
}
|
|
|
|
h2 {
|
|
position: sticky;
|
|
top: 0;
|
|
background-color: inherit;
|
|
padding: 10px 0 10px 0;
|
|
font-weight: 400;
|
|
text-align: center;
|
|
}
|
|
|
|
p {
|
|
font-size: 20px;
|
|
color: #323232;
|
|
font-weight: 300;
|
|
}
|
|
|
|
p + p {
|
|
margin-top: 20px;
|
|
}
|
|
|
|
p, h2 {
|
|
margin: 0;
|
|
}
|
|
|
|
img {
|
|
display: block;
|
|
}
|
|
|
|
input {
|
|
position: fixed;
|
|
top: 20px;
|
|
left: 15px;
|
|
z-index: 11;
|
|
display: block;
|
|
padding: 5px;
|
|
border: solid 1px rgba(136, 136, 136, 0.7);
|
|
border-radius: 4px;
|
|
background-color: rgba(255, 221, 64, 0.8);
|
|
margin-right: 5px;
|
|
}
|
|
|
|
label {
|
|
position: fixed;
|
|
z-index: 10;
|
|
left: 10px;
|
|
top: 10px;
|
|
display: block;
|
|
padding: 10px;
|
|
padding-left: 30px;
|
|
border-radius: 4px;
|
|
background-color: rgba(255, 221, 64, 0.8);
|
|
}
|
|
|
|
:checked ~ .sticky-container {
|
|
position: relative;
|
|
box-shadow: 0 0 0 2px #000;
|
|
}
|
|
:checked ~ .sticky-container > * {
|
|
opacity: 0.8;
|
|
} |