Drupal add class to body if page is unpublished
in your theme's template.php:

function mytemplate_preprocess_html(&amp;$vars) {
  $node = menu_get_object();
  if ($node &amp;&amp; isset($node-&gt;nid)) {
    if ($node-&gt;status) {
      $vars['classes_array'][] = 'published';
    } else {
      $vars['classes_array'][] = 'unpublished';
    }
  }
}