input中的icon图标


//html代码

<div class="input_con">
<p >
<i class="iconfont_user"></i>
<input id="username" name="username" type="text" autocomplete="off" placeholder="请输入用户名" />
</p>
</div>
<div class="input_con">
<p>
<i class="iconfont_pass"></i>
<input id="password" name="password" type="password" placeholder="请输入密码" />
</p>
</div>

 

//css代码

.iconfont_user {
display: inline-block;
height: 27px;
width: 29px;
background-repeat: no-repeat;
position: absolute;
z-index:9999;  //让图标显示在图层的最顶层
background-image: url(../images/input-user.png);
margin-top: 36px;
margin-left: 20px;
}
.iconfont_pass {
display: inline-block;
height: 27px;
width: 29px;
background-repeat: no-repeat;
position: absolute;
z-index:9999;  //让图标显示在图层的最顶层
background-image: url(../images/input-pass.png);
margin-top: 36px;
margin-left: 20px;
}


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM