• /* Set background image to fixed (don't scroll along with the page) */ background-attachment: fixed
  • To control the background attachment of an element at a specific breakpoint, add a {screen}: prefix to any existing background attachment utility.
  • The background-attachment property in CSS dictates how a background image behaves when a user scrolls a page or an element.
  • background-attachment: local, new to CSS3, causes an element's background to be fixed to the actual element itself.
  • The background-attachment CSS property sets whether a background image's position is fixed within the viewport, or scrolls with its containing block.
  • background-repeat: repeat-y, repeat-y; background-position: left, right; background-attachment: fixed, fixed
  • The following examples use the background-attachment attribute and the background-attachment property to set the background to "fixed"...
  • The following classes control the background attachment of elements ... CSS equivalent: background-attachment: fixed; Example usage
  • height: 200px; background-image: url(https://www.sample-videos.com/img/Sample-jpg-image-100kb.jpg); background-attachment: local; overflow: auto
  • The background-attachment CSS property sets whether a background image's position is fixed within the viewport, or scrolls with its containing block.