Nicekiwi
Nicekiwi

Reputation: 4807

How can I set a background image to scroll with scrolling content?

<div>Content</div>

div{width:100px;height:100px;background:url('../images/image.gif') fixed repeat;overflow:auto;}

The text within the dev scrolls over the background, how do I make the content scroll with the content. (assuming the content extends below the bottom of the div)?

Does that make sense?

Edit: I want the background image to move with the content when its scrolled down.

The background image should move upwards with the content as you scroll down the div.

Upvotes: 0

Views: 2932

Answers (3)

xxkoreanlegendxx
xxkoreanlegendxx

Reputation: 1

Try using the different blocks of background (background-image, etc.)

Upvotes: -1

Claude
Claude

Reputation: 879

div{
 width:100px;
 height:100px;
 background:url('../images/image.gif') repeat scroll center top transparent;
}

Upvotes: 0

sqwk
sqwk

Reputation: 1596

Remove the fixed from your background declaration. Is that what you mean by scrolling with the content?

div { width:100px; height:100px; background:url('../images/image.gif') repeat; }

Upvotes: 2

Related Questions