background-attachment

The background-attachment property is used to specify whether or not the background image scrolls with the document.

The possible values are.

PropertiesDescription
fixedthe image is fixed relative to the view-port
scrollthe image is fixed relative to the document, and the two will be scrolled together (the default value)

snippet
<html>
<head>
<style>
p {width:300px; height:250px; background-image: url(bg.jpg)}
</style>
</head>
<body>
<form>
<p style="background-attachment: fixed; overflow: fixed">
Commodi numquam adipisci sit consequatur vitae saepe beatae, vero sit dignissimos
harum accusamus fuga iusto facilis expedita omnis beatae, dolorum perferendis harum
blanditiis nemo cumque dignissimos recusandae a aliquid, laboriosam</p>
<p style="background-attachment: fixed; overflow: scroll">
Commodi numquam adipisci sit consequatur vitae saepe beatae, vero sit dignissimos
harum accusamus fuga iusto facilis expedita omnis beatae, dolorum perferendis harum
blanditiis nemo cumque dignissimos recusandae a aliquid, laboriosam</p>
</form>
</body>
</html>
Related Tutorial
2. Padding
3. Margin
4. Border
5. Cursors
Follow Us
https://www.facebook.com/Rookie-Nerd-638990322793530 # # # # #