CSS Tutorial

CSS Background Attachment

<!DOCTYPE html>
  div {
    padding: 70px;
    height: 70px;
    width: 150px;
    background-image: url("/pix/samples/bg2.png");
    overflow: auto;
    background-attachment: fixed;
  The background image is fixed - it doesn't scroll with its outer container. This example uses the CSS overflow property to force the box to scroll when there's too much text to fit in the box.