Sexy Input Styling Example with CSS
For the app I am currently making, I wanted to create transparent inputs with rounded corners and styled placeholders.
In researching how to do this, I found there was a surprisingly small set of nice examples for me too follow and very little information in general. Below is the look I was going for. Primarily, I wanted the background of the input transparent and rounded white borders. Additionally, I wanted the placeholder to standout and “fit” with the background and overall look.
How I made it (Gist)
The obvious thing to note here, is simply created a class such as .MyInput with styling and adding it to your input as normal is not going to do anything. You must specifically target using input[type=”input”]. The type can be switched out for any other type of form element.
If you wanted to style forms differently, you could always nest the class by adding .myForm in front of the input[type=”input”]. Simply add the myForm class to your form tag, and now only the form with a class of myForm will receive the styling you specify.