我们如何使用CSS样式重叠两个图像? [英] How can we overlap two images using css style?

查看:121
本文介绍了我们如何使用CSS样式重叠两个图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个html表中的图像列表,需要在每个图像上重叠一个小图标。我们如何使用z索引和定位?

I have a list of images in an html table and need to overlap a small icon on each image. How can we do this using z index and positioning?

推荐答案

请参阅这里。 http://jsbin.com/univa

<html>
<head>
<style type="text/css">
.under
{
position:absolute;
left:0px;
top:0px;
z-index:-1;
}
.over
{
position:absolute;
left:40px;
top:10px;
z-index:-1;
}
</style>
</head>

<body>
<img src="http://www.prototypejs.org/images/codesample1.gif" width="184" height="46" class="under" />
<img src="http://mootools.net/assets/images/mootools.png" width="184" height="46" class="over" />

</body>
</html>

这篇关于我们如何使用CSS样式重叠两个图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆