I created a page in called “mypage”.
Then I created a custom template page called “page_mypage.php”.
Now, I just wanted to create some custom CSS classes in style.css.
I tried with:
div.page-mypage-php #myclass{}
but I get no results. What’s the correct way of doing this?
The styles are not created in CSS, they are created in page markup.
If your theme and template are coded properly they make use of
body_class()
function, that will output number of classes for you to make use of in page source.View source of your page and
<body>
tag to see what you have available and can target in CSS for your page.