Or you can disable the label on input and build the label yourself:
Disables the wrapping div and the label from showing
<?php echo $form->input('password', array('maxLength' => '20', 'div'
=> false, 'label' => false)); ?>
Build the label manually
<?php echo $form->label('password', __('password', true), array
('class' => 'label')); ?>
On Dec 10, 5:29 pm, maytawn <[EMAIL PROTECTED]> wrote:
> Thanks. I will try what you suggest. I know that it is better to
> avoid inline CSS where possible. But in this case it is styling that
> will only be used in one very specific place and I didn't want to
> clutter the main CSS file with such an insignificant snippet. But I
> can live with doing that way if I have to.
>
> Thanks again.
>
> On Dec 10, 4:23 pm, Lane <[EMAIL PROTECTED]> wrote:
>
> > Hi maytawn,
>
> > I would advise against using the inline css to style the label tag. I
> > would recommend adding the CSS to your file but specify a specific
> > label defininition for the cake forms. For example the form helper
> > automatically wraps the form elements and labels in a div with an
> > appropriate classname for the type of form element. So to style the
> > labels for a form input you could use:
>
> > div.input label { width: 300px; }
>
> > Let me know if that helps.
>
> > - Lane
>
> > On Dec 10, 4:43 pm, maytawn <[EMAIL PROTECTED]> wrote:
>
> > > I have an instance where I need to increase the width and style of the
> > > <label> tag that is automatically created with the $form->input()
> > > method. Since I already have a base CSS defined for all <lable> tags
> > > I would like to add some inline CSS using the style="" attribute. I
> > > am able to add the style="" attribute to the <input> tage using the
> > > 'options' key 'style' as shown below.
> > > echo $form->input('password', array('label' => 'New Password:', 'type'
> > > => 'password', 'style' => 'width:150px', 'after' => '<br />'));
>
> > > Is there a way to pass in a parameter that would allow me to do the
> > > same for the <lable> tag?- Hide quoted text -
>
> > - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---