JSFiddle - React, Tailwind, and code Playground

by Philip Rogers

HTML

<!DOCTYPE html>

<div id="fixeda"></div>

<div id="squished"></div>

<div id="fixedb"></div>

<div id="forcescroll"></div>

CSS

#fixeda {
    position: fixed;
    left: 100px;
    top: 100px;
    width: 200px;
    height: 200px;
    border: 1px solid black;
    background-color: skyblue;
}

#fixedb {
    position: fixed;
    left: 50px;
    top: 50px;
    width: 100px;
    height: 100px;
    border: 1px solid black;
    background-color: lightgreen;
}

#squished {
    position: absolute;
    left: 125px;
    top: 125px;
    width: 100px;
    height: 100px;
    border: 1px solid black;
    background-color: pink;
}

#forcescroll {
    position: absolute;
    left: 0;
    top: 0;
    width: 1px;
    height: 2000px;
}