'background-attachment' Example : background attachment « CSS Attributes and Javascript Style Properties « HTML CSS Reference






'background-attachment' Example

    
<html>
<body>
<div style="background:blue url(http://www.java2s.com/style/logo.png) repeat top left; 
            width:200; 
            border:3; 
            height:150; font-size:14">www.java2s.com</div>
            <br><br><br><br><br><br><br><br><br>
<div style="background-color:red; 
            background-attachment:fixed; 
            background-image:url(http://www.java2s.com/style/logo.png); 
            background-repeat:repeat; 
            background-position-x:top; 
            background-position-y:left; 
            width:200; 
            border:3; 
            height:150; 
            font-size:14">www.java2s.com</div>
Text
</body>
</html>

    
      
      








Related examples in the same category

1.'background-attachment' Syntax and Note
2.'background-attachment' Possible Values
3.'background-attachment' is applied to