diff --git a/modules/field/field.module b/modules/field/field.module index 4182e88a1b02ec9dd2735405390c29be3a9aa655..25b9c826513731882d2168576adc8340b6d8bed6 100644 --- a/modules/field/field.module +++ b/modules/field/field.module @@ -980,6 +980,11 @@ function template_preprocess_field(&$variables, $hook) { 'field-type-' . $variables['field_type_css'], 'field-label-' . $element['#label_display'], ); + // Add a "clearfix" class to the wrapper since we float the label and the + // field items in field.css if the label is inline. + if ($element['#label_display'] == 'inline') { + $variables['classes_array'][] = 'clearfix'; + } // Add specific suggestions that can override the default implementation. $variables['theme_hook_suggestions'] = array( @@ -1090,7 +1095,7 @@ function theme_field($variables) { $output .= '</div>'; // Render the top-level DIV. - $output = '<div class="' . $variables['classes'] . ' clearfix"' . $variables['attributes'] . '>' . $output . '</div>'; + $output = '<div class="' . $variables['classes'] . '"' . $variables['attributes'] . '>' . $output . '</div>'; return $output; }