<div class="wrapper">
    <div class="absolute">
      <p>position: absolute;<br>
       top: 30px;<br>
       left: 40px;
     </p>
    </div>
    <div class="fixed">
      <p>position: fixed;<br>
       top: 30px;<br>
       left: 220px;
     </p>
    </div>
</div>
.wrapper {
  height: 1000px;
}
.absolute, .fixed {
  width: 150px;
  height: 150px;
}
.absolute p, .fixed p {
  padding: 10px;
  color: #FFF;
}
.absolute {
  position: absolute;
  top: 30px;
  left: 40px;
  background-color: #ba2636;
}
.fixed {
  position: fixed;
  top: 30px;
  left: 220px;
  background-color: #1e50a2;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.