html中input标签放入小图标 - 三千世界a

时间:2024-03-06 19:20:13

html中input标签放入小图标

直接上代码

<style type="text/css">
    *{
        margin: 0;
        padding: 0;
    }
    .box{
        width: 200px;
        position: relative;
    }
    .box .icon-search{
        width: 20px;
        height: 20px;
        position: absolute;
        top: 6px;
        right: 0;
    }
    .box .username{
        padding-left: 30px;
        height: 25px;
    }
</style>
</head>
<body>
<div class="box">
   
    <input type="text" class="username" />
    <i class="icon-search">图</i>
</div>
</body>