开发者

How to overlay an image over another image?

I开发者_JAVA百科 want one image above the other. How can I do it?

How to overlay an image over another image?

http://twitpic.com/2cnpku


from the code you posted, it appears you are passing an img element into another src attribute of another img element. Is there a reason you are doing this?

<style type="text/css">
  .imgA1 {
    position:absolute;
    top:0px;
    left:0px;
    z-index:2;
    width:1300px;
    height:283px;
  }
  .imgB1 {
     position:absolute;
     top:0px;
     left:0px;
     z-index:1;
     width:1300px;
     height:1000px;
  }
</style>
<img class="imgA1" src="images/home_nav.png" alt="home_nav" />
<img class="imgB1" src="images/paperbackground.png" alt="Background" />

A similar code mockup can be seen at http://jsfiddle.net/gBPBd/3/ with my images to prove the concept and it is funcitoning in chrome, ie8.


Set the image you want on top to have a higher z-index. Right now, it has a lower z-index.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜