Freesnöw
Freesnöw

Reputation: 32143

Forcing the background to be a static background

I have a background created using the following css:

<body onload='javascript:initializeQuiz()' style='background-image:url("images/bi.png");background-repeat:repeat;font-family:Arial'> 

It is a repeating picture of some "binary" (just a bunch of random 0's and 1's for a dramatic effect). When I scroll, the background scrolls too. How would I make the background not scroll but allow the text and images on top to scroll?

Thanks if you can!

Upvotes: 3

Views: 292

Answers (2)

JEEND0
JEEND0

Reputation: 482

Add background-attachment:fixed; to your style attribute:

<body onload='javascript:initializeQuiz()' style='background-image:url("images/bi.png");background-repeat:repeat;font-family:Arial;background-attachment:fixed;'>

Upvotes: 6

Quentin
Quentin

Reputation: 943567

background-attachment

Upvotes: 4

Related Questions