post_class not working with css

First of all, <?php post_class(); ?> function prints a string that contains html 'class' attribute. So, whenever you are using this function inside class attribute, then you are actually printing another class attribute inside class attribute. That’s why your class is not working.

Secondly, since <?php the_content(); ?> function may contains <p> tag, that’s why never use <?php the_content(); ?> function inside <p> tag. That will break your style that you wrote for the_content block. Instead <p> tag, use <div>.

So, you may try with this:

<li <?php post_class();?>><?php the_title(); ?></li>
<div <?php post_class(); ?>><?php the_content(); ?></div>