Search code examples
csswordpressshortcode

How to add CSS to a specific div class - WordPress


I am using a Wordpress theme named KALLYAS, and I am having trouble adding CSS to a specific class. This theme uses multiple shortcodes. So lets say I want to add a background with CSS to the gray area on the homepage only WITHOUT EFFECTING THE GRAY AREA ON ANY OTHER PAGE. also how would I go about adding CSS to a shortcode on a specific page aswell? I am guessing it is same way.


Solution

  • That worked because if you notice on the code in the theme preview it says :

    <body class="**home** page page-id-17 page-template-default res1170" data-twttr-rendered="true">
    

    it would also work if you used any of them like :

    .page-id-17 .greyarea { color:#ccc }
    
    .home.page-id-17 .greyarea { color:#ccc }