Image-free, custom-styled search bar

Posted by Jon on Stack Overflow See other posts from Stack Overflow or by Jon
Published on 2012-11-26T16:07:54Z Indexed on 2012/11/26 17:04 UTC
Read the original article Hit count: 147

Filed under:
|

I'm working with the designer and he sent me the following design for the search bar on our webpage:

enter image description here

I'm very much against using images in webpage design unless completely necessary, so I'm hoping that I can recreate the whole search bar widget in CSS. I know how to do border-radius, gradients, box-shadows, etc, so that's not a problem.

Question: Assuming CSS3 browser compatibility, how can I go about recreating the actual search button (the magnifying glass portion) with the double curved edge, and the slight drop shadow on the bottom left?

Thoughts: My initial feeling was that the search button would be circular and free-standing, then overlap the search input div with a negative left-margin, but then I was unsure how I would get that drop shadow.

Edit: I'm not completely opposed to using an image for the magnifying glass, but I've seen a similar icon created in CSS before. Would an image vs. pure CSS end up loading at the same speed, or should I do all I can do in pure CSS?

© Stack Overflow or respective owner

Related posts about css

Related posts about css3