Hi you should start looking into
https://codex.wordpress.org/CSS
Would this work for you?
<?php $first_query = new WP_Query( 'posts_per_page=2' ); ?>
<?php if ( $first_query->have_posts() ) : while ( $first_query->have_posts() ) : $first_query->the_post(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class( 'style-one-class-name' ); ?>>
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<?php if ( has_post_thumbnail() ) {
the_post_thumbnail();
} ?>
<?php echo excerpt(30); ?>
</div>
<?php endwhile; ?>
<?php wp_reset_query(); ?>
<?php endif; ?>
<?php $second_query = new WP_Query( 'posts_per_page=2&offset=2' ); ?>
<?php if ( $second_query->have_posts() ) : while ( $second_query->have_posts() ) : $second_query->the_post(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class( 'style-two-class-name' ); ?>>
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<?php if ( has_post_thumbnail() ) {
the_post_thumbnail();
} ?>
<?php echo excerpt(30); ?>
</div>
<?php endwhile; ?>
<?php wp_reset_query(); ?>
<?php endif; ?>
<?php $third_query = new WP_Query( 'posts_per_page=2&offset=4' ); ?>
<?php if ( $third_query->have_posts() ) : while ( $third_query->have_posts() ) : $third_query->the_post(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class( 'style-one-class-name' ); ?>>
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<?php if ( has_post_thumbnail() ) {
the_post_thumbnail();
} ?>
<?php echo excerpt(30); ?>
</div>
<?php endwhile; ?>
<?php wp_reset_query(); ?>
<?php endif; ?>
The different stylings are created by the “post_class( ‘style-one-class-name’ )” and “post_class( ‘style-two-class-name’ )” classes that you would create.
‘style-one-class-name’ would be for posts 1,2 and 5,6 and ‘style-two-class-name’would be for posts 3,4.
‘style-one-class-name’ and ‘style-two-class-name’ would be different sets of styles in your theme’s CSS style – such as ‘style-one-class-name’ could be named “blue-posts” and ‘style-two-class-name’ could be “red-posts”.
This is from Codex: https://codex.wordpress.org/Function_Reference/post_class#Adding_More_Classes