将图标放在表单中的输入元素内并移动图标

时间:2014-12-21 15:19:45

标签: html css forms input

我输入了输入图标,我正试图移动它。

自:

first

second

HTML:

<input type="text" name="username" placeholder="Въведе потребителско име ...">

CSS

#contact input[name='username']{
    background:url('../image/icon/user.png'), #ebebeb;
    background-repeat: no-repeat, repeat;
    background-position: right;
    width: 355px;
    padding: 10px;
    padding-left: 10px;
    padding-right:55px;
    border: 0px;  
    margin-top: 6px;
    transition: box-shadow 0.3s;
}

2 个答案:

答案 0 :(得分:0)

background-position: 0 5px 0 0;

而不是

background-position: right;

答案 1 :(得分:0)

尝试将此添加到您的CSS代码

margin-right:10px;