图片替换技术:

1、行内 变 块级
.test1_h1{
width: 154px;
height: 30px;
background-image: url("../img/logo_db.png");
/*超出隐藏*/
overflow: hidden;
.test1_a{
height: 34px;
display: block;
line-height: 200px;
}

2、颜色变透明
.test2_h1{
background-image: url("../img/logo_db.png");
width: 154px;
height: 30px;
}
.test2_a{
color: transparent;
}

3、利用text-indent
.test3_h1{
background-image: url("../img/logo_db.png");
width: 154px;
height: 30px;
text-indent: -300px;
}
.test3_a{
display: block;
}

4、利用行内变块级
.test4_h1{
width: 51px;
height: 47px;
position: relative;
font-size: 12px;
}
.test4_h1 span{
background-image: url("../img/20150416H1049_53Uux_03.png");
position: absolute;
width: 100%;
height: 100%;
display: block;
}

posted @ 2016-03-22 21:56  脸大陈小姐  阅读(141)  评论(0编辑  收藏  举报