This kind of approach is terrific, because it means that if you ever want to go to a traditional form approach of labels-left, fields-right, you just float all your <spans> and assign them a width of 50%.
Last edited by mikepurvis; 08-09-2005 at 10:08 PM.
The separated labels work the same way without the additional mark up, though. That gives me an idea, though, about using the wrapping labels but declare them display:block. I must play.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." Brian W. Kernighan
But I think it's classier to use the <label> as the wrapper, since then you don't need to introduce another class-- it's just label span that's known to be the element of the labeltext.
Yes, the more variety in the tags, the more styling fodder for the CSS. Depending on other design considerations, there may be no need for that div class as its "uniqueness" can be refactored up into its containers like the inclosing block or the form itself.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." Brian W. Kernighan
It doesn't work for me. You see, I want to have three blocks in one line and each block I can have as many INPUT as I want.
I don't understand what you want.
If you just want three fields in a row, then you need to set the width of label to 33%. I'm not sure if you're trying to do fixed or liquid, so here's two versions:
Now, if you're try to do three columns of fields, then each "column" needs to be wrapped in something and floated. (fieldset would be a good choice...)
Bookmarks