I am trying to get a magnifying glass as the background for my input element. The magnifying glass icon is part of the CSS sprite, which looks like this:

To position it, I used these properties:
#search-form input[type="text"] { background: url('../images/icons.png') no-repeat left center; background-position: 0px -30px; border: 1px solid #a9e2ff; padding: 3px; width: 200px; font-size: 1em; padding-left: 20px; }
But the background still appears at the top of the input window, rather than being aligned in the vertical middle and left. I also tried:
background: url('../images/icons.png') no-repeat left middle;
but it doesnβt work either.
If that matters, although I assume this does not happen, here is my form markup:
<form action="/search" method="get" id="search-form"> <input type="text" placeholder="Search..." name="s"> </form>
Thanks for any help.
source share