diff --git a/includes/webform.components.inc b/includes/webform.components.inc
index 4dafc3e..74dcdcb 100644
--- a/includes/webform.components.inc
+++ b/includes/webform.components.inc
@@ -406,6 +406,31 @@ function webform_component_edit_form($form, $form_state, $node, $component, $clo
     '#parents' => array('extra', 'title_display'),
   );
 
+  // Custom CSS class settings.
+  $form['custom_css'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('Custom CSS'),
+    '#collapsible' => TRUE,
+    '#collapsed' => TRUE,
+    '#weight' => 10,
+  );
+  $form['custom_css']['wrapper_classes'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Wrapper CSS Class(es)'),
+    '#default_value' => isset($component['extra']['wrapper_classes']) ? $component['extra']['wrapper_classes'] : '',
+    '#description' => t('Apply the above CSS class(es) to the wrapper of field.  Separate by space.'),
+    '#weight' => -1,
+    '#parents' => array('extra', 'wrapper_classes'),
+  );
+  $form['custom_css']['css_classes'] = array(
+    '#type' => 'textfield',
+    '#title' => t('CSS Class(es)'),
+    '#default_value' => isset($component['extra']['css_classes']) ? $component['extra']['css_classes'] : '',
+    '#description' => t('Apply the above CSS class(es) to the field.  Separate by space.'),
+    '#weight' => 0,
+    '#parents' => array('extra', 'css_classes'),
+  );
+
   // Validation settings.
   $form['validation'] = array(
     '#type' => 'fieldset',
diff --git a/webform.module b/webform.module
index 715b960..9811826 100644
--- a/webform.module
+++ b/webform.module
@@ -1938,6 +1938,11 @@ function _webform_client_form_add_component($node, $component, $component_value,
     if ($element = webform_component_invoke($component['type'], 'render', $component, $data, $filter)) {
       $parent_fieldset[$component['form_key']] = $element;
 
+      // add custom css classes to the field
+      if (isset($component['extra']['css_classes']) && drupal_strlen($component['extra']['css_classes'])) {
+        $parent_fieldset[$component['form_key']]['#attributes']['class'] = explode(' ' , $component['extra']['css_classes']);
+      }
+
       // Override the value if one already exists in the form state.
       if (isset($component_value)) {
         $parent_fieldset[$component['form_key']]['#default_value'] = $component_value;
@@ -2421,6 +2426,12 @@ function theme_webform_element($variables) {
    'webform-component',
    'webform-component-' . $type,
   );
+
+  $extra = $element['#webform_component']['extra'];
+  if (isset($extra['wrapper_classes']) && drupal_strlen($extra['wrapper_classes'])) {
+    $wrapper_classes = array_merge($wrapper_classes, explode(' ', $extra['wrapper_classes']));
+  }
+  
   $output = '<div class="' . implode(' ', $wrapper_classes) . '" id="webform-component-' . $parents . '">' . "\n";
   $required = !empty($element['#required']) ? '<span class="form-required" title="' . t('This field is required.') . '">*</span>' : '';
 
