background-attachment

The background-attachment CSS property specifies the type of attachment the background image to the viewport or an element. If the background image is fixed within the viewport or scrolls along the element or its content. The condition is to determine the background-image property.

Values of the background-attachment property

fixed | scroll | local

The initial value scroll

fixed

The background image  is fixed relatively to the viewport. If the element  or the content of the element is scrolling  the background image stays unmoved. In paged media where there is no viewport, a ‘fixed’ background is fixed relatively to the page box and therefore replicated on every page.

scroll

The background image is fixed relatively to the element itself and do not scroll with its content.

local

The background image is fixed relatively to the element. If the content is scrolling, the background scrolls with it. The element and the color of background area is painted from the edge of padding – they are relative to the scrollable area of container what excludes borders.

Examples

background-attachment: fixed;

div {
    width:50%;
    border:50px solid rgba(63, 32 , 33, 0.7);
    padding:20px;
    background-color:#FFB7C5 ;
    background-image:url('../images/image-zo-2.png');
    background-position:20% 50%;
    background-repeat:no-repeat;
    background-attachment:fixed;
}
Then cats take over the world if it fits, i sits for climb leg, or destroy couch, and hate dog stick butt in face. Inspect anything brought into the house eat a plant, kill a hand. Chase ball of string chase mice, yet under the bed has closed eyes but still sees you spit up on light gray carpet instead of adjacent linoleum meow all night having their mate disturbing sleeping humans. Scratch the furniture meow yet play riveting piece on synthesizer keyboard play riveting piece on synthesizer keyboard. Vommit food and eat it again get video posted to internet for chasing red dot. Purr while eating love to play with owner’s hair tie or cat slap dog in face. Hide from vacuum cleaner chew on cable sun bathe i am the best. Stand in front of the computer screen meowing non stop for food lounge in doorway and paw at your fat belly so meow all night having their mate disturbing sleeping humans so hide when guests come over. Eat a plant, kill a hand. Leave dead animals as gifts burrow under covers vommit food and eat it again or meowwww so claws in your leg for love to play with owner’s hair tie. Hide head under blanket so no one can see jump around on couch, meow constantly until given food, meow spit up on light gray carpet instead of adjacent linoleum yet intrigued by the shower kick up litter.

background-attachment: scroll;

div {
    width:400px;
    height:400px;
    overflow:scroll;
    border:50px solid rgba(63, 32 , 33, 0.7);
    padding:20px;
    background-color:#FFB7C5 ;
    background-image:url('../images/image-zo-2.png');
    background-repeat:no-repeat;
    background-position:50% 0;
    background-attachment:scroll;
}

Submit your own Cat Ipsum copy!Then cats take over the world if it fits, i sits for climb leg, or destroy couch, and hate dog stick butt in face. Inspect anything brought into the house eat a plant, kill a hand. Chase ball of string chase mice, yet under the bed has closed eyes but still sees you spit up on light gray carpet instead of adjacent linoleum meow all night having their mate disturbing sleeping humans. Scratch the furniture meow yet play riveting piece on synthesizer keyboard play riveting piece on synthesizer keyboard. Vommit food and eat it again get video posted to internet for chasing red dot. Purr while eating love to play with owner’s hair tie or cat slap dog in face. Hide from vacuum cleaner chew on cable sun bathe i am the best. Stand in front of the computer screen meowing non stop for food lounge in doorway and paw at your fat belly so meow all night having their mate disturbing sleeping humans so hide when guests come over. Eat a plant, kill a hand. Leave dead animals as gifts burrow under covers vommit food and eat it again or meowwww so claws in your leg for love to play with owner’s hair tie. Hide head under blanket so no one can see jump around on couch, meow constantly until given food, meow spit up on light gray carpet instead of adjacent linoleum yet intrigued by the shower kick up litter.

Love to play with owner’s hair tie present belly, scratch hand when stroked chase imaginary bugs, but meow meow all night having their mate disturbing sleeping humans. Bathe private parts with tongue then lick owner’s face rub face on everything, but stick butt in face, and put toy mouse in food bowl run out of litter box at full speed , and chase ball of string. Chew iPad power cord claw drapes sleep nap hide when guests come over plan steps for world domination meow meowwww. Scratch the furniture why must they do that throwup on your pillow, so the dog smells bad and loves cheeseburgers curl into a furry donut cat slap dog in face. Hunt by meowing loudly at 5am next to human slave food dispenser chew on cable or run in circles have secret plans shake treat bag, eat and than sleep on your face cat snacks. Chase dog then run away. Knock dis off table head butt cant eat out of my own dish damn that dog and spit up on light gray carpet instead of adjacent linoleum but jump launch to pounce upon little yarn mouse, bare fangs at toy run hide in litter box until treats are fed hide at bottom of staircase to trip human, so chase dog then run away or sweet beast. Eat and than sleep on your face find empty spot in cupboard and sleep all day hide when guests come over, yet scratch leg; meow for can opener to feed me vommit food and eat it again attack feet. Give attitude chase laser. Destroy couch. Inspect anything brought into the house. Behind the couch. Hunt by meowing loudly at 5am next to human slave food dispenser chew iPad power cord, or leave fur on owners clothes. Hiss at vacuum cleaner inspect anything brought into the house, chase ball of string eat a plant, kill a hand and all of a sudden cat goes crazy hunt anything that moves. Chew foot hide from vacuum cleaner, i like big cats and i can not lie, and chew on cable stand in front of the computer screen. Peer out window, chatter at birds, lure them to mouth give attitude. Leave fur on owners clothes scream at teh bath caticus cuteicus but peer out window, chatter at birds, lure them to mouth or plan steps for world domination. Who’s the baby flop over, but i am the best swat at dog. Curl into a furry donut sit in box chase mice the dog smells bad sit by the fire, paw at your fat belly. Spot something, big eyes, big eyes, crouch, shake butt, prepare to pounce hunt anything that moves. Always hungry find something else more interesting, and hack up furballs lick butt, yet lounge in doorway always hungry. Purr while eating cat slap dog in face attack feet, but chase red laser dot cough furball ignore the squirrels, you’ll never catch them anyway ears back wide eyed. Has closed eyes but still sees you who’s the baby, for eat a plant, kill a hand. Intently sniff hand i like big cats and i can not lie bathe private parts with tongue then lick owner’s face and hunt by meowing loudly at 5am next to human slave food dispenser and chase mice chase imaginary bugs favor packaging over toy. Cat slap dog in face.

Sit in box vommit food and eat it again cough furball for meow. Run in circles chase red laser dot chase ball of string find empty spot in cupboard and sleep all day but jump launch to pounce upon little yarn mouse, bare fangs at toy run hide in litter box until treats are fed so stare at the wall, play with food and get confused by dust. Kick up litter pooping rainbow while flying in a toasted bread costume in space meowwww purr for no reason hunt anything that moves. Bathe private parts with tongue then lick owner’s face. Sit by the fire leave hair everywhere, yet plan steps for world domination or hunt by meowing loudly at 5am next to human slave food dispenser and cat snacks, for throwup on your pillow chase laser. Jump launch to pounce upon little yarn mouse, bare fangs at toy run hide in litter box until treats are fed. Plan steps for world domination eat a plant, kill a hand, chase dog then run away. Meowwww get video posted to internet for chasing red dot. Cat snacks damn that dog for always hungry or lick arm hair. Chew iPad power cord eat a plant, kill a hand run in circles eat and than sleep on your face. Chase dog then run away stretch, yet flop over who’s the baby, yet loves cheeseburgers jump off balcony, onto stranger’s head.

background-attachment: local;

div {
    width:400px;
    height:400px;
    overflow:scroll;
    border:50px solid rgba(63, 32 , 33, 0.7);
    padding:20px;
    background-color:#FFB7C5 ;
    background-image:url('../images/image-zo-2.png');
    background-repeat:no-repeat;
    background-position:50% 0;
    background-attachment:local;
}
Have secret plans climb leg purr while eating but make meme, make cute face. Hide head under blanket so no one can see vommit food and eat it again, but hopped up on catnip. Run in circles ears back wide eyed sweet beast. Eat grass, throw it back up leave fur on owners clothes hopped up on catnip, but see owner, run in terror jump around on couch, meow constantly until given food, for lounge in doorway so spit up on light gray carpet instead of adjacent linoleum. Chase mice. Present belly, scratch hand when stroked the dog smells bad or meow. Play riveting piece on synthesizer keyboard chase ball of string but paw at your fat belly for i like big cats and i can not lie. Make muffins lounge in doorway leave fur on owners clothes meowing non stop for food sit in box chase red laser dot. Swat at dog hunt anything that moves hate dog, and swat at dog, or chase laser. Stretch give attitude favor packaging over toy. Scream at teh bath caticus cuteicus nap all day stare at ceiling. Find empty spot in cupboard and sleep all day make muffins, for all of a sudden cat goes crazy, for hide when guests come over, but eat and than sleep on your face. Rub face on everything then cats take over the world but poop on grasses but knock dis off table head butt cant eat out of my own dish or always hungry for all of a sudden cat goes crazy, spit up on light gray carpet instead of adjacent linoleum. Find empty spot in cupboard and sleep all day leave hair everywhere, for hiss at vacuum cleaner but pelt around the house and up and down stairs chasing phantoms so hide from vacuum cleaner find something else more interesting. If it fits, i sits lounge in doorway scream at teh bath. Intently sniff hand get video posted to internet for chasing red dot, and sit in box, so who’s the baby jump around on couch, meow constantly until given food, for make meme, make cute face the dog smells bad. Vommit food and eat it again give attitude, but eat grass, throw it back up, so chase ball of string yet chase ball of string or inspect anything brought into the house. Intently sniff hand give attitude, yet meowwww present belly, scratch hand when stroked leave hair everywhere roll on the floor purring your whiskers off, for paw at your fat belly. Fall over dead (not really but gets sypathy) rub face on everything sleep on keyboard, and hide at bottom of staircase to trip human but attack feet, yet meow. Jump around on couch, meow constantly until given food, loves cheeseburgers jump off balcony, onto stranger’s head or ignore the squirrels, you’ll never catch them anyway but my left donut is missing, as is my right cough furball. Cat snacks fall over dead (not really but gets sypathy) paw at your fat belly. Poop on grasses jump around on couch, meow constantly until given food, rub face on everything burrow under covers, but lick arm hair and throwup on your pillow. The dog smells bad eat a plant, kill a hand jump off balcony, onto stranger’s head or sleep on keyboard, so sleep in the bathroom sink so sleep nap. Attack feet sweet beast hunt by meowing loudly at 5am next to human slave food dispenser.

Related

Resources

 

Browser compatibility

background-attachment

Internet Explorer
IE 8 does not support local
Supported from IE 9
Firefox
1.0
Chrome
1.0
Safari
1.0
Opera
3.5
Mobile
Safari Mobile
fixed: the background image is positioned but scrolls with content.
Android
fixed: 4.1
Chrome Mobile
fixed: on Android - the background image is positioned but scrolls with content.
IE Phone
fixed: the background image is positioned but scrolls with content.
Opera Mobile
fixed: the background image is positioned but scrolls with content.
Notes

Firefox on Android
background-attachment: fixed; - buggy, the background image is positioned but it has 'jumpy' effect.
backgrund-attachment: local; - does not work, the background image is not positioned at all.

UC Browser: (tested on UC Browser 10.5)
background-attachment:fixed; - works.
background-attachment: scroll; - works.
background-attachment:local; does not work, the background image is not positioned at all.