Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Form input text color on blur

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #39389
    svoltmer
    Participant

    I have a login form with placeholder text defined with a gray color. I would like when a user enters there name into the username input and then clicks the password input field to have the font color on the username switch back the the gray of the placeholder text. Is there a way to do this with only CSS or do I have to use Javascript?

    #107968
    Paulie_D
    Member

    You just need to set a color when the input field has focus.

    http://codepen.io/Paulie-D/pen/BIqFv

    #107973
    svoltmer
    Participant

    Thats what I have in place now. I would like the user entered text to remain the black as focus is changed to the next input to show that the user has filled that input.

    #108094
    Paulie_D
    Member

    Aha…found what I was looking for:

    Search google and CSS-Tricks has the answer all along: https://css-tricks.com/snippets/css/style-placeholder-text/

    #108047
    Paulie_D
    Member

    @death180 That’s not what he wants.

    He wants the placeholder to be ‘grey’
    A color for text being input (as it’s input)…can be any color
    A (possibly) third color (black) to show the entered text once the user moves on to the next box.

    Like this: http://codepen.io/Paulie-D/pen/asEiq

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘CSS’ is closed to new topics and replies.