您的位置:首页 > 其它

使用font-awesome 在input框中增加一个图标

2017-07-17 12:06 357 查看
比如:

    在登录框增加一个用户头像 ,提示用户输入用户名



<html>

<link href="http://libs.baidu.com/fontawesome/4.4.0/css/font-awesome.min.css" rel="stylesheet"/>

<style>

.wrapper { position: relative; }

i.fa { position: absolute; top: 5px; left: 5px; }

.wrapper input { text-indent: 20px;}

</style>

<body>

<div class="wrapper">

    <i class="fa fa-user"></i>

    <input type="text" placeholder="username ">

</div>

<div class="wrapper">

    <i class="fa fa-key"></i>

    <input type="text" placeholder="password">

</div>

        </body>

</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: