Treehouse: Grow your CSS skills. Land your dream job.

What pseudo state for textarea???

  • # June 21, 2012 at 8:21 pm

    Hey guys,

    Please take a look at this pen (sorry i use sass+compass):

    What i am trying to do is fake a placeholder for two reasons, 1) I want the place holder to stay visable on normal input[type=text] and 2) I wanted to try and give some support to older/non-html5 browsers.

    The thing is i’m having two problems:
    1) Only working in chrome don’t know why lol
    2) On the textarea it makes sense for it to go away but i can’t figure out how to get rid of it when user has inputted text into the textarea field

    Does anyone have any ideas please?

    Thank you long time lol


    **Edited to tidy code up slightly**

    # June 21, 2012 at 8:58 pm


    thank you

    # June 22, 2012 at 12:59 am

    I’m pretty sure there is a javascript fix for the HTML5 tag “placeholder=” to make it work everywhere if that’s what you need.

    # June 22, 2012 at 6:25 am

    What @Odd_E said – placeholder=”placeholder text here” works in browsers that support it. That being said I would also recommend using label’s from an accessibility point of view and for older browser support.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.