Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="extra"></div>
- <div id="wrapper">
- <div class="sticky">
- sticky
- </div>
- <div class='sticky sticky-subject'>sdjfnsa</div>
- </div>
- <div class="extra"></div>
- .sticky {
- position: sticky;
- position: -webkit-sticky;
- background: #f83d23;
- width: 100px;
- height: 100px;
- top: 70px;
- display: flex;
- justify-content: center;
- align-items: center;
- box-shadow: 0 0 6px #000;
- color: #fff;
- z-index: 10;
- }
- .sticky-subject{
- z-index: 0;
- top: 170px;
- height: 300px;
- overflow: hidden;
- background-color: green;
- }
- .extra,
- #wrapper {
- width: 75%;
- margin: auto;
- background-color: #ccc;
- margin-bottom: 60px;
- }
- #wrapper {
- height: auto;
- }
- .extra {
- height: 100px;
- }
- body {
- font-family: georgia;
- height: 1000px;
- }
- h4 {
- text-align: center;
- }
- @media (min-height: 768px) {
- #wrapper{
- height: 2000px;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement