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

Home Forums CSS Label in forms

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #34707

    I’ve been goofing around lately trying to make my forms look better. While doing so, I have toyed with the two ways of using labels :




    With the same CSS, the two forms DO NOT yield the same result. I’ve found advantages and disadvantages for both structures. I have learned to like the second method because the LABEL becomes a container for the INPUT. I have only tested with FireFox. Has anyone done any comparisons of the two forms on other navigators? I was just curious what y’all use and why?


    I agree with @TT_Mark, the second method states that the text box is its own label, which doesn’t make sense.

    If you’re doing it that way strictly to have a container element, use a div or whatever works best for your form.


    Thanks all for the thoughts. I used the second manner recently because it gave me an interesting css layout. My pages are generated via php so it’s quite simple to change from one manner to the other. I generally use method 1.

    Yes, thank you Rob, I do use id, but forgot it in my question.

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