Nikita Shchypylov
Nikita Shchypylov

Reputation: 367

How can i set background-image for input tag?

I have this code atm:

<form id="" class="cf" action="">
        <div class="input_wrap cf">
            <label for="test"></label>
            <input id="test" type="text">
        </div>
    </form>

and here is css code :

    .test {
        display: inline-block;
        max-width: 100%;
        background: url("../img/magnifying_glass_icon.svg") no-repeat right;
}

Where can be problem? Tried lot of variants Thanks

Upvotes: 0

Views: 51

Answers (2)

praveen
praveen

Reputation: 1375

Try this

#test 
{
  display: inline-block;
  max-width: 100%;
  background: url("../img/magnifying_glass_icon.svg") no-repeat scroll center right;
}

Upvotes: 2

Patrick Knudsen
Patrick Knudsen

Reputation: 291

Try this

.test {
        display: inline-block;
        max-width: 100%;
        background: url("../img/magnifying_glass_icon.svg") no-repeat scroll center right;
}

Upvotes: 0

Related Questions