Add CSS class to  element using webform and template file I have an existing webform in Drupal 7 which I am trying to theme.
So far I managed to add CSS classes, placeholders, prefix, suffix,.. to form elements (fields) but not to the actual &lt;form&gt;-tag?

I tried this:

$form['#attributes']['class'][] = 'form-horizontal';`


But that didn't change anything to the output.

edit: I have found that putting var_dump($form['#attributes']); displays the array below the form-tag. Does that mean that you cannot alter the root element inside a template file (webform-form-8.tpl.php) and that I should implement the hook in template.php?
I believe your edit is correct. You should add the class in a preprocessor function within template.php. 

A similar question and answer can be found here.