[Catalyst] Styling HTML::Widget elements

Dave Hodgkinson davehodg at gmail.com
Fri Apr 21 16:35:46 CEST 2006


Top-quoting for effect, because everything you say is good and  
relevant :)

If you go back through the archives I raised this a couple of weeks ago
and the consensuses were:

1. Forget CSS and use a stylesheet to put the elements in tables
2. Use a ContentContainer from the current trunk HTML::Widget to DTRT  
(irc conversation?).
3. Do the iteration of down the elements in the template to do what  
you need
4. Something else.

On 21 Apr 2006, at 15:23, Tobias wrote:

> I'm checking out (Catalyst::Plugin::)HTML::Widget at the moment and  
> have come
> across a problem styling the label tag. The HTML generated by  
> HTML::Widget
> looks like this:
>
> <label for="login_user" id="login_user_label">
> Username:<input class="textfield" id="login_user" name="user"  
> size="25"
> type="text" />
> </label>
>
> Now styling the <label> tag and setting a fixed width for it to get  
> all input
> elements vertically aligned does not work, because the <label> tag  
> is wrapped
> around the <input> tag and thus the specified width is for both,  
> the <label>
> AND the <input> tag. Because the <label> tag already has a "for"  
> attribute it
> is not neccessary to put it around the associated <input> element.  
> What do you
> think?
>
> The following would be much easier to style IMHO:
>
> <label for="login_user" id="login_user_label">Username:</label>
> <input class="textfield" id="login_user" name="user" size="25"  
> type="text" />
>
> I'd be glad to hear that someone has already found a CSS solution  
> to this or
> if HTML::Widget should be patched to have the <label> tag before  
> and not around
> the input element tags (actually that's also what the W3C does in  
> the examples:
> http://www.w3.org/TR/WD-html40-970708/interact/forms.html#edef-LABEL)
>
> Sorry if this is not directly Catalyst related.
>
> Thanx!
>
> Toby
>
> _______________________________________________
> Catalyst mailing list
> Catalyst at lists.rawmode.org
> http://lists.rawmode.org/mailman/listinfo/catalyst

-- 
Dave Hodgkinson - Music photography
http://www.hodgkinson.org/





More information about the Catalyst mailing list