Interactive online courses HTML Academy
2026-03-09 12:55 Diff

Usually, the background image scrolls together with the content of the block. This can be clearly seen in the mini-browser. Scroll down in the window and watch how the background moves upwards.

With the background-attachment property, the background can be locked in place and will not move when you scroll.

The property value is:

  • scroll – The background scrolls along with the content. This is the default value.
  • fixed – The background does not scroll. It is fixed in one place.

This is a case where it is easier to show than to offer an explanation: complete the assignment and watch how the background behavior changes as you scroll.