logo
g Text Version
Beauty & Self
Books & Music
Career
Computers
Education
Family
Food & Wine
Health & Fitness
Hobbies & Crafts
Home & Garden
Money
News & Politics
Relationships
Religion & Spirituality
Sports
Travel & Culture
TV & Movies

dailyclick
Bored? Games!
Nutrition
Postcards
Take a Quiz
Rate My Photo

new
Action Movies
Bible Basics
Houseplants
Romance Movies
Creativity
Family Travel
Southwest USA


dailyclick
All times in EST

Low Carb: 8:00 PM

Full Schedule
g
g HTML Site

BellaOnline's HTML Editor

g

The Cascading Style Sheets Background Attachment Property

Guest Author - Diane Cipollo

The Cascading Style Sheets background-attachment property is used to control how the background image will behave on the webpage.
With CSS you can set the background image to move with the webpage as it scrolls (scroll) or to always remain visible as the page scrolls (fixed).

Let's take a look at an example.

Example
<style type="text/css">
<!--
body {background-attachment: scroll}
-->
</style>


Selector
body
To control a background image on your webpage you would use the body selector in the HTML <body> tag to tell the web browser to apply this style to the background image of the entire webpage.

Property
background-attachment
The background-attachment is the attribute used to tell the web browser how to control the behavior of the background image. The property name, background-attachment, is followed by a colon (:).

Value
scroll
On the right side of the colon is the value for the background-attachment attribute. In our example, we want the image to scroll with the webpage. So we have set the value to scroll. In this case the background image will scroll as the webpage scrolls and the image will eventually disappear from view. If we wanted the background image to always remain visible as the webpage scrolls, you would set the value to fixed.




This site needs an editor - click to learn more!

Add The+Cascading+Style+Sheets+Background+Attachment+Property to Twitter Add The+Cascading+Style+Sheets+Background+Attachment+Property to Facebook Add The+Cascading+Style+Sheets+Background+Attachment+Property to MySpace Add The+Cascading+Style+Sheets+Background+Attachment+Property to Del.icio.us Digg The+Cascading+Style+Sheets+Background+Attachment+Property Add The+Cascading+Style+Sheets+Background+Attachment+Property to Yahoo My Web Add The+Cascading+Style+Sheets+Background+Attachment+Property to Google Bookmarks Add The+Cascading+Style+Sheets+Background+Attachment+Property to Stumbleupon Add The+Cascading+Style+Sheets+Background+Attachment+Property to Reddit




RSS | Editor's Picks Articles | Top Ten Articles | Previous Features | Site Map


For FREE email updates, subscribe to the HTML Newsletter


Past Issues


print
Printer Friendly
bookmark
Bookmark
tell friend
Tell a Friend
forum
Forum
email
Email Editor


Content copyright © 2014 by Diane Cipollo. All rights reserved.
This content was written by Diane Cipollo. If you wish to use this content in any manner, you need written permission. Contact BellaOnline Administration for details.

g


g features
What's Coming in HTML 5

What is FTP?

HTML Fundamentals - Tables

Archives | Site Map

forum
Forum
email
Contact

Past Issues
memberscenter


vote
Poetry
Daily
Weekly
Monthly
Less than Monthly



BellaOnline on Facebook
g


| About BellaOnline | Privacy Policy | Advertising | Become an Editor |
Website copyright © 2014 Minerva WebWorks LLC. All rights reserved.


BellaOnline Editor