background-attachment: scroll : background attachment « CSS « HTML / CSS






background-attachment: scroll

  

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Positioning Backgrounds</title>
<style type="text/css">
body {
    font: 16px Verdana, Arial, Helvetica, sans-serif;
    margin: 20px;
    color: black;
    background-color: #FFFFCC;
    background-image: url(background-square.gif);
    background-attachment: scroll;
}
</style>
</head>
<body>
<p>this is a test. this is a test. this is a test. this is a test. 
this is a test. this is a test. this is a test. this is a test. 
this is a test. this is a test. this is a test. this is a test. 
this is a test. this is a test. this is a test. this is a test. </p>
<p><em>MA</em></p>
</body>
</html>

   
  








Related examples in the same category

1.'background-attachment' Example
2.Use background-attachment:scroll to scroll a background image when the user scrolls the content. This is the default value.
3.Use background-attachment:fixed to prevent the image from scrolling.
4.background-attachment: fixed;background-position: center;
5.background-attachment: fixed;
6.Set background-attachment to fixed