Freelancer's Playground! New knowledges every now and then

6Feb/074

Active Input

Well, I think some of you confused while reading the title of the post. I just can't find any good word. The idea of this post is to show you how to create simple CSS to show which form input is active. You know, when working with so many input box, you'll sometime forgot what field you're working on. Even when there's cursor blinking on it.

So, here's what I usually do.

<style>
    input:focus, textarea:focus, select:focus, checkbox:focus, radio:focus{
        background-color: lightblue;
        border: 1px #bbbbbb solid;}
    input, textarea, select, checkbox, radio{
        background-color: lightgreen;
        border: 1px #bbbbbb solid;
}</style>

Name

Address

Email

See? it's quite simple. But it work!!!

  • http://mbu.web.id/ mBu

    hmm.. simple but very nice indeed.. :)

  • http://mbu.web.id mBu

    hmm.. simple but very nice indeed.. :)

  • http://www.ftpcommerce.com/ Ivan

    Did you try it in IE? Seems that input:focus don’t work in IE, but you can fix it!
    Just look at my contact form (http://www.ftpcommerce.com/kontakt.php) and press Ctrl+U in Firefox cause you obviously use only FF :P

  • http://www.ftpcommerce.com Ivan

    Did you try it in IE? Seems that input:focus don’t work in IE, but you can fix it!
    Just look at my contact form (http://www.ftpcommerce.com/kontakt.php) and press Ctrl+U in Firefox cause you obviously use only FF :P