CSS Trickery in form fields

So this one caught be completely by surprise - never seen such a thing before. Last.fm (which is a great site in its own right) utilizes a rounded-end input field. How do they do this, pray tell? Well, with lots of CSS and the clever use of a single GIF image:

Last.fm search image

You can source the CSS yourself, which is long and maybe a little too involved for the results, but what I love is the attention to detail - including a selected state in the same image, and shifting its position when a user focuses the search field is such a nice touch.

Comments \ 1

  1. brad

    only compromise is that certain browsies don’t style form elements. so, this will work in those that do, but won’t in those that … don’t. (safari.)

Leave a comment