开发者

Two separate background images

开发者 https://www.devze.com 2022-12-19 07:55 出处:网络
I want to have my page to have two background images: one at the top, and one at the bottom. I don\'t want them static, though. How开发者_开发问答 would I do this?Make two nested layers with zero marg

I want to have my page to have two background images: one at the top, and one at the bottom. I don't want them static, though. How开发者_开发问答 would I do this?


Make two nested layers with zero margin and padding, like so:

<div class="outer">
  <div class="inner">
    <!-- Page goes here. -->
  </div>
</div>

Then have a separate background-image for outer and inner, one fixed to the top, one fixed to the bottom:

.outer {
  background-position: bottom;
  // ...
}

.inner {
  background-position: top;
  // ...
}


It really depends on what you need the page to look like and what the background images are. If you want a solution you need to post more detail preferably with a composite image of whatthe page should look like and an example of the images by themselves.

that said one way might be:

html {backgoround: trasnparent url(/path/to/image) scroll no-repeat top center;}
body {backgoround: trasnparent url(/path/to/other-image) scroll no-repeat bottom center;}


Use divs with background images and place them appropriately either using your layout or with the positioning attributes. You could take the one for the top, put it in a div that is absolutely positioned and z-indexed to be underneath your regular page. Then the other one could be put in the body style and positioned at the bottom.

0

精彩评论

暂无评论...
验证码 换一张
取 消