In your template.php (sites/all/themes/THEMENAME/template.php), you can preprocess the variables to make alterations before block.tpl.php* serves them up. You can do this using the hook_preprocess_block().
How to add a class to your blocks using hook_preprocess_block()
With the following example, you can add the class "clearfix" to your system blocks. In your function, you'll replace hook with your theme name:function THEMENAME_preprocess_block(&$variables) {
$variables['classes_array'][]='clearfix';
}
How to add a class to the title of your blocks using hook_preprocess_block()
With the following example, you can add the class "title" to the title (h2 element) of your system blocks. In your function, you'll replace hook with your theme name:function THEMENAME_preprocess_block(&$variables) {
$variables['title_attributes_array']['class'][] = 'title';
}
Finally, you should clear all caches through Administration » Configuration » Performance » Clear all caches. This step is important in order to force your template to be informed for the changes you have made in the template files.
*Most themes utilize their own copy of block.tpl.php. The default is located inside modules/block/block.tpl.php.
In case this article leaves any of your questions or concerns unanswered, please feel welcome to email us or post a public question.
More than (just) Themes
http://www.morethanthemes.com/