z-index: 1001; /* 数值可以自定义,不能与其他元素的数值重复。 */
left:250px; /* 左边显示位置 */
top:200px; /* 顶部显示位置*/
position: absolute; /* 绝对定位,整个浏览器页中的定位*/
position: relative; /* 相对定位,在当前DIV中相对定位*/
<div id="center">
<div style="z-index: 1001;height:500px;width:500px;background-color: peachpuff;left:250px;top:200px;position: absolute;"></div>
</div>
图片操作:
css代码:注意:div,2个img均设置position:
.student_1{position: relative;height: 80px; width:19%;float: left;padding-top: 20px;}
.logo{width:40px;height:40px;position: relative; }
.selected{height:20px;width:20px;left:0px;top:15px;position: absolute;}
html代码
<div class=“student_1”>
<img class="logo" src="images/boy.png"> <!-- 女学生的图片是girl.png -->
<img class="selected" src="images/selected.png">
</div>