How to use field value as class? Drupal 7
This should be a start.

function mytheme_preprocess_node (&amp;$variables)
{
  $node = $variables["node"];

  if (isset($node-&gt;field_foo["und"][0]["taxonomy_term"])) {
    foreach ($node-&gt;field_foo["und"] as $foo) {
      $term = $foo["taxonomy_term"];
      $variables["classes_array"][] = "term-" . str_replace(" ", "-", strtolower($term-&gt;name));
    }
  }
}


Note, this is barely tested  and your exact situation may vary.  It assumes field_foo is the machine name for your taxonomy reference, and your theme is flattening $variables["classes_array"] for use in node.tpl.php.