CSS code for “inserting a custom post divider” after each post

With this code the divider is inserted between posts, checks if the current post is the first one, and if it isn’t, it inserts the divider. This avoids the divider to show up after the last post, and before the first one.

while( have_posts() ):
    the_post();

    if( 0 < $wp_query->current_post ):
        echo '<div>My div!</div>';
    endif;

    the_title();
    the_excerpt();


endwhile;