Archived topic
Custom Heading Colors for A Category
3 replies · Started by Praveen on March 26, 2021
Hi Guys,
Is it possible to have a customer Heading color for h1, H2 and H3 valid within a post for a category?
If H1 is not possible, h2 and h3?
For example, if category A post is shown the heading colors will be specific while for rest of the website it uses the common heading colors.
Hi there,
you can use the Post classes to target the specific category.for example:
.single-post .category-composting h1,
.single-post .category-composting h2,
.single-post .category-composting h3 {
color: #f00;
}
This will change the h1, h2, h3 of any single post in the compositing category.
If you wan't different colors for each heading just create individual CSS rules eg.
/* Only H1 in post category composting */
.single-post .category-composting h1 {
color: #f00;
}
Thanks a lot!
Can I use Font-size: to change the font size too?
For sure:
/* Only H1 in post category composting */
.single-post .category-composting h1 {
color: #f00;
font-size: 24px;
}