[thelist] Styling in-line elements

Will willthemoor at gmail.com
Tue Mar 17 21:41:32 CDT 2009


>> You see, we're trying to develop these forms so they hold the user's hand as
>> much as possible (that's what has been requested), so often there's a nice
>> explanation before an input element. Perhaps it would be best to both have
>> the explanation and then a separate label....you know what, that actually
>> would be better.
>
> I agree.
>

Me too.  Our default form mark up is <li><label /><input /></li> - we
figured it's a list of form elements. A stretch perhaps but nothing
seemed more appropriate and it allows us the control that's sometimes
required. For instance, we can put class="error" on the li and work
our css for the inner elements from there. I also wind up using
something like class="checkwrap" on the li for styling of input
type=radio and type=checkbox since they're almost certainly laid out
differently from normal label/input pairs. The <li> also allows you to
semantically group things like additional information, hints and error
messaging. Of course, all of the same can be done with a div or p, I
just think it's more of an li.

As far as "inline elements" remaining inline, I don't buy it. I may be
wrong but I think that's really only a display distinction in the
first place. It's not at all like using <p><strong>for a
headline</strong><p>.

Will



More information about the thelist mailing list