Question

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?

Était-ce utile?

La solution

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

Autres conseils

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.

Yii Theming

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top