Background

The CSS background properties handle the display of background effects on HTML elements.

background-attachment

The background-attachment CSS property defines how the background of an element scrolls relative to its containing parent, and it looks like this:

background-attachment: fixed;

Description

There are three values: scroll, fixed, and local.

  • scroll: The background does not move within its container
  • fixed: The background stays fixed to the viewport, no matter what
  • local: The background scrolls within its container and the viewport

CSS:

.scroll {
  background-attachment: scroll;
}
.fixed {
  background-attachment: fixed;
}
.local {
  background-attachment: local;
}

Here is a demo in CodePen: http://tiny.cc/css-background

background-blend-mode ...

Get Web Developer's Reference Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.