Position Fixed

In this example we demonstrate how to use the CSS property position fixed that allows us to lock elements to a particular positions (e.g. headers and footers).

The CSS code is listed below:

index.html.haml
#fixed {
  top: 0;
  left: 0;
  width: 100%;
  position: fixed;
  background-color: yellow;
  text-align: center;
}