wordpress has a clean way of outputting the class name for a post item - using post_class
so in your case first set the div to
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>...</div>
and to add the taxonomy name to the class you have to add a filter. So in your functions.php drop this in (change YOUR_TAXO_NAME to the name of your custom taxonomy): (taken from here)
add_filter( 'post_class', 'custom_taxonomy_post_class', 10, 3 );
if( !function_exists( 'custom_taxonomy_post_class' ) ) {
function custom_taxonomy_post_class( $classes, $class, $ID ) {
$taxonomy = 'YOUR_TAXO_NAME';
$terms = get_the_terms( (int) $ID, $taxonomy );
if( !empty( $terms ) ) {
foreach( (array) $terms as $order => $term ) {
if( !in_array( $term->slug, $classes ) ) {
$classes[] = $term->slug;
}
}
}
return $classes;
}
}
(for multiple taxonomies add an array)
$taxonomy = array('YOUR_TAXO_NAME_1', 'YOUR_TAXO_NAME_2');
and that should add the post type name as well as the taxonomy its tagged in to the div class