Forums

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

Home Forums CSS Label as placeholder in firefox

  • This topic is empty.
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #45695
    pallavi1811
    Participant

    Hi

    I am facing a prob in firefox.

    the code is written here:
    http://cdpn.io/JrCus

    in firefox, the label is coming outside the textbox, whereas in other browsers, it comes as a “placeholder”. is there any way i can make this label as placeholder in firefox as well.

    Please help

    #139561
    CrocoDillon
    Participant

    Looks the same in IE10/Chrome/FF (outside the textbox) to me…

    #139563
    pallavi1811
    Participant

    no it comes as below.

    #139565
    pallavi1811
    Participant

    it comes as below in chrome:

    #139566
    CrocoDillon
    Participant

    Not on a 1920px wide screen.

    #139568
    pallavi1811
    Participant

    ok so what can i do?

    #139570
    Paulie_D
    Member

    This looks wrong:

    Can you have an input **inside** a label? That seems counter-intuitive.

    #139571
    Paulie_D
    Member

    >in firefox, the label is coming outside the textbox, whereas in other browsers, it comes as a “placeholder”. is there any way i can make this label as placeholder in firefox as well.

    Why not just use the placeholder attribute?

    EG ``

    #139572
    CodeGraphics
    Participant

    But it’s showing here. check your styling.

    http://codepen.io/codegraphics/full/vfwAC

    #139578
    Kitty Giraudel
    Participant

    Label != placeholder.

    #139577
    CrocoDillon
    Participant

    > Can you have an input inside a label?

    Yes, but only it’s labeled control (see [label](http://www.w3.org/TR/html5/forms.html#the-label-element))

    > “The label represents a caption in a user interface. The caption can be associated with a specific form control, known as the label element’s labeled control, either using for attribute, or by putting the form control inside the label element itself.” – http://www.w3.org/TR/html5/forms.html#labeled-control

    You can even skip the `for` attribute if the input is inside the label :)

    #139579
    Paulie_D
    Member

    >Looks the same in IE10/Chrome/FF (outside the textbox) to me…

    Ditto at multiple screen sizes.

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