How can I capitalize the first letter of an input ?

Posted by Safirio on Stack Overflow See other posts from Stack Overflow or by Safirio
Published on 2010-06-15T14:47:49Z Indexed on 2010/06/15 14:52 UTC
Read the original article Hit count: 148

Filed under:

I'm currently trying to capitalize the very first letter from an input.

Here's what I tryed :

fieldset input
{
    text-transform:capitalize;
}

But it doesn't work the way I want, as every word is capitalized.

I also tryed this :

fieldset input:first-letter
{
  text-transform:uppercase;
}

But it seems <input /> doesn't work at all with first-letter...

Anyway, do you have any idea of how to achieve this without javascript (or as little as possible) ?

© Stack Overflow or respective owner

Related posts about css