How to apply css styles to codeigniter dropdown?

form_dropdown('dropdown', $options, $selected, 'style="width: 240px; font-size: 13px"');
You could just as easily add a class to the  and then add the styles in your stylesheet:
form_dropdown('dropdown', $options, $selected, 'class="foo"');
In either case, if you don't have a value for $selected, set it to array()
form_dropdown('dropdown', $options, array(), 'style="width: 240px; font-size: 13px"');
Although you could get away setting it to null or '' for convenience.

No comments:

Post a Comment