How to right align text in custom form textfield in Drupal 7? I have a custom form with a textfield that takes numeric values (temperature). I want to right-align the text typed in textfield. Should I use CSS or is there a Drupal attribute to do this?

Here's the present code:

$form['temperature'] = array(
            '#type' =&gt; 'textfield',
            '#title' =&gt; 'Answer',
            '#description' =&gt; 'Enter temperature in &amp;deg; Fahrenheit',
            '#required' =&gt; TRUE,
            '#size' =&gt; 6,
            '#maxlength' =&gt; 6,
            '#field_suffix' =&gt; '&amp;deg; Fahrenheit',
            '#element_validate' =&gt; array('_myform_temperature_validate'),
        );
Yes, add a custom class, or use an existing one. You can add custom CSS styles to your form using #attached.