White flat search form styling with CSS

06.05.2013 by Ilia Raiskin
HTML CSS Design

In this tutorial you are going to learn how to create a simple, white and flat designed search form with HTML & CSS. Note that we only do the styling in this tutorial.


Download

Demo



Code

HTML

CSS

Explanation

We can style the placeholder of an element with ::placeholder. At the moment you have to use prefixes for Webkit, Mozilla and Microsoft. Note that Mozilla has two different versions, because one has a single semicolon and newer version has two. When a user puts our text-input into focus the placeholder text becomes transparent.


About the author

Ilia Raiskin

Ilia Raiskin is a web designer, web developer, blogger and founder of Toolinfy.com.






Comment