怎么在图片上面加个div层,让它浮于图片上方

时间:2016-04-24 14:07:33   收藏:0   阅读:384

1、首先当然是要插入一张图片啦,
代码如下:<a href="#" target="_blank"><img src="images/13.png" width="240" heigth="240"></a>
图片路径自己定义。

2、定义一个层在图片上。这里要用到定位。position。
<div class="con_img"><img src=""><span class="ms"></span></div>
.con_img{position: relative; width: 240px; height: 240px;}
.ms{position: absolute; bottom: 0;left: 0; width: 240px; height: 25px; background: #000;}

原文:http://www.cnblogs.com/Jack1ee/p/5426757.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!