1 fixed background + 1 tiled background in CSS
My target is that a spider is going down it's web in the b开发者_如何学Pythonackground. I need the web image (a simple vertical line) to tile above the spider, while the spider image sits at the bottom.
You can't have two background images on the same element.
Simply, create a div
right inside your body
that takes full width and height. Then use the tiled background in one of them (the div
, I assume) an the fixed background in the other (the body
, I assume).
Watch out for margins and padding across browsers, though!
WebKit (Safari, Chrome) does allow multiple backgrounds; just seperate them with commas.
maybe you put "the spider" as fixed background image for your <body>
tag and put "the web" as a background image (with repeat) for a div set to { width: 100%; }
精彩评论