how can i place search icon in the search field. This icon is in the front of the search field while search button follows the search bar. something like this-
how can i place search icon in the search field. This icon is in the front of the search field while search button follows the search bar. something like this-
Here's the CSS code that I'd use:
Note: I added a lot of extra codes to make the search box look better, the necessary code to make the search box apear is padding-left, background-image:url, background-repeat and background-position. Replace "http://i47.tinypic.com/r02vbq.png" with whatever search icon you want.
It's also important to know that now in HTML5, most browsers render
with a search icon. The input type search makes it a search box, with a "x" button to clear, and adding "results" also displays a search box. Of course you could also add an x button with CSS and JavaScript to a regular search box. It's also important to note that input type search allows very little styling. Demo on Safari on a Mac:
Demo
i Hope it works out for you.
Use below code usonh bootstrap css. This code easily implement in your page.
Use Bootstrap and there is default icon file i which used tag .
I f you want different icon then you can use here.
HTML Code:-
CSS :-
Its an simple and small example without any wrapper of divs, single element that is input type with icon on the left.
Checkout this code fiddle to get an idea of how it can be accomplished:
http://codepen.io/anon/pen/GoXKyg