How to add a css class to the nodes in the front page according to taxonomy of each node in drupal 7?
Supposing that "field_tags" is the taxonomy field for which you want to use the taxonomy term values, you could use the following code.

function theme_preprocess_html(&amp;$variables, $hook) {
  if ($variables['is_front']) {
    $terms = array();

    foreach ($variables['page']['content']['system_main']['nodes'] as $nid =&gt; $array) {
      $items = field_get_items('node', $array['#node'], 'field_tags');
      foreach ($items as $tid) {
        if (!isset($terms[$tid]) &amp;&amp; ($term = taxonomy_term_load($tid))) {
          $terms[$tid] = drupal_html_class($term-&gt;name);
        }
      }
    }

    if (!empty($terms)) {
      foreach ($terms as $class_name) {
        $variables['classes_array'][] = $class_name;
      }
    }
  }
}