How can I add a class to displays a category?

Instead of using the_category, I would just build the category links manually and add the category slug as the class name. Something like this:

<span class="post_into">
    <?php
        $thelist="";
        $i = 0;
        foreach( get_the_category() as $category ) {
            if ( 0 < $i ) $thelist .= ', ';
            $thelist .= '<a href="' . esc_url( get_category_link( $category->term_id ) ) . '" class="' . $category->slug . '">' . $category->name.'</a>';
            $i++;
        }
        echo $thelist;
    ?>
</span>