<div class="scroll">
  <div class="parent">
    <b class="static">.static</b>
    <b class="sticky">.sticky</b>
    <b class="fixed">.fixed</b>
  </div>
  <div class="parent">
    <b class="static">.static</b>
    <b class="sticky">.sticky</b>
  </div>
  <br><br><br><br><br><br><br><br><br><br>
</div>
<b class="sticky">.sticky</b>
<br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br>
.scroll {
  display: inline-block;
  width: 200px;
  height: 148px;
  overflow: auto;
  padding: 0 4px;
  vertical-align: middle;
  border: 4px solid #000;
}
.parent {
  height: 60px;
  margin: 4px 0;
  border: 4px solid #666;
}
.static {
    position: static;
    background: gray;
}
@supports (position: sticky) or (position: -webkit-sticky) {
  .sticky {
      position: -webkit-sticky; /* 사파리 브라우저 지원 */
      position: sticky;
      top: 4px;
      background: red;
  }
}
.fixed {
    position: fixed;
    top: 20px;
    left: 116px;
    background: blue;
}
body {
  color: #fff;
  background-image: linear-gradient(#fff 12px, #eee 12px, #eee 24px);
  background-size: 100% 24px;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.