[html-formfu] Why not div (instead of span) for container_tag?

Carl Franks fireartist at gmail.com
Fri Mar 7 18:58:31 GMT 2008


On 06/03/2008, Jeff Dairiki <dairiki at dairiki.org> wrote:
> I've just started using FormFu.   And I think it's great.  (Thank you.)
>
>  Here's one thing that's been bothering me though.   Most of the field
>  types use (by default) a <span> for their container_tag.  It seems to
>  me that the default (for most field types) should be a <div>.
>
>   - Generally, it would seem one would want each field on a new line ---
>    <div> expresses that, <span> does not.
>
>   - The default output without CSS is nearly unreadable.
>
>   - The vertically aligned css (which so far is the only good
>    example CSS for FormFu I've found --- are there others?) converts
>    all these spans to display: block, in any case.
>
>
>  So why the design decision to use the <span>s?  I'm guessing (from
>  what I've seen with the rest of the code) that there's a good reason
>  but (as outlined above) I can't figure out what it is.
>
>  I know I can change the element_defaults (and I have).  But if there's
>  a good reason to stick with <span>s please tell me before I get too
>  far along with my <div>s.

To quote myself from an email on the html-widget list on 23/03/07...

" At the moment the default is 'span', but I'm starting to come round to
the idea of changing it to 'div', for a better default layout without
css. "

So I can't really argue with myself ;)

I've tested changing the online cssapp to use divs, and it doesn't
make any difference to the layout with the vertically-aligned css, but
does look much better when viewed without css.

So, yes, I think we might as well change it.
Anyone else with an opinion on this?

Carl



More information about the HTML-FormFu mailing list