css图片上加文字

第一种方法:
添加一个DIV,采用绝对定位,图片所属DIV为基准
<div style="position:relative;100px;height:100px;">
    <img src="" alt="" />
    <div style="position:absolute;100px;height:100px;z-indent:2;left:0;top:0;">
        文字
    </div>
</div>
第二种方法:图片作为背景图片
<div style="background:url(abc.jpg) no-repeat left top;">
    wenzi
</div>

比较推荐第一种

原文地址:https://www.cnblogs.com/codeDevotee/p/7485864.html