You’ve probably see the search box which expands when you click on the search icon. Sofia Koletzaki explains how it’s done with CSS3 transitions.
http://www.sofiakoletzaki.com/search-form-with-css3-transitions/