I'm developing web site using Yii framework. I need form and use CActiveFormWidget. How can I style input fields and buttons with CSS? Which is the CSS class for button or textfield?
Asked
Active
Viewed 2,501 times
1
-
1You could check with firebug. There's also a `form.css` that handles input styling. – adamors Jul 02 '12 at 07:47
2 Answers
2
If not necessary to modify existing classes you can assign class to each text field and button by passing class attribute
<?php
echo $form->textField($model,'search',array(
'size'=>60,
'maxlength'=>255, '
class'=>'search'
)); ?>
other than that if you want to change default form css it is form.css
and you would need to look into div.form input, div.form textarea, div.form select
depending on your needs

Afnan Bashir
- 7,319
- 20
- 76
- 138
2
You can use your custom themes for your website. Yii supports to themes. You can create your own theme in Themes folder, and you can define your theme in config file main.php.

Onkar Janwa
- 3,892
- 3
- 31
- 47