/ Published in: CSS
Neat CSS fixed background image scrolling 'trick'
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<style type="text/css"> body { padding:0; margin:0; background:#fff; } .content { padding:10px 20px 10px 200px; border-bottom:1px solid #666; background-color: trasnsparent; background-repeat: no-repeat; background-position: 20px 20px; background-attachment: fixed; } .green { background-image: url(images/circle_green.gif); } .yellow { background-image: url(images/circle_yellow.gif); } .red { background-image: url(images/circle_red.gif); } .purple { background-image: url(images/circle_purple.gif); } .blue { background-image: url(images/circle_blue.gif); } .content p { font:normal 12px/18px verdana; color:#000; } </style> </head> <body> <div class="content green"> </div> <div class="content blue"> </div> <div class="content yellow"> </div> <div class="content purple"> </div> <div class="content red"> </div>
URL: http://www.askthecssguy.com/examples/fixedBackgroundImages/example02.html