styling A word press content manually with code

Viewed 28

im trying to style my WP post which is located in Single.php file , for the record this file contains

">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div  <?php post_class() ?> id="post-<?php the_ID(); ?>">
     <div class="card-header">
            <h2><a title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
     </div>
     <div class="card-body">
           <div class="entry">
                  <?php the_content(); ?>
            </div>
     </div>
</div>
<?php endwhile; endif; ?>

and i dont know how to style it cus there are no classes for anything in the said posts . any ideas how to style my content with code and manually ???

2 Answers
You can do it with following code.

first you will have to declare a class 

<div  <?php post_class() ?> id="post-<?php the_ID(); ?>" <?php post_class("my-custom-css"); ?>>

now you define css in your theme css file

.my-custom-css{
//do css stuff here
}

You can give it a class name and then create a custom css for the just created style

Related