error in plugin does not get any result

i want to add some style in plugin it is possible to add ?
like this
i created a plugin and try to all image border automatic after plugin active. but not working it is possible how to solve this.

<?php
add_action('init', 'portfolio_register22');    
function portfolio_register22() {   ?>
<style>
.img
{
border: 4px solid #FFF;
position: relative;
border-radius: 4px;
box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.2);
box-shadow: 0px 0px 3px #888;
border-radius: 55px;
}
</style>
<?php
}
?>

Related posts

Leave a Reply

1 comment

  1. add these following code in your plugin and try it

    <?php
        // Add css to wp_head()
        function child_head_styles() {
            ?>
        <style>
        .img
        {
         border: 4px solid #FFF;
         position: relative;
         border-radius: 4px;
         box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.2);
         box-shadow: 0px 0px 3px #888;
         border-radius: 55px;
        }
        </style>
        <?php
        }
        add_action( 'wp_head', 'child_head_styles' );
    ?>